Example #1
0
 def TestAll(ss):
     """
     TestAll runs through the full set of testing items
     """
     err = ss.TestEnv.SetParas(go.Slice_string([ss.Words1, ss.Words2]))
     if err != 0:
         gi.PromptDialog(go.nil, gi.DlgOpts(Title= "Words errors",
             Prompt= err.Error()), gi.AddOk, gi.NoCancel,
             go.nil, go.nil)
         return
     ss.TestEnv.Init(ss.TrainEnv.Run.Cur)
     while True:
         ss.TestTrial(True)
         chg = ss.TestEnv.CounterChg(env.Epoch)
         if chg or ss.StopNow:
             break
Example #2
0
def TestItemCB2(recv, send, sig, data):
    win = gi.Window(handle=recv)
    vp = win.WinViewport2D()
    dlg = gi.Dialog(handle=send)
    if sig != gi.DialogAccepted:
        return
    val = gi.StringPromptDialogValue(dlg)
    idxs = TheSim.TestEnv.Table.RowsByString("Name", val, True, True) # contains, ignoreCase
    if len(idxs) == 0:
        gi.PromptDialog(vp, gi.DlgOpts(Title="Name Not Found", Prompt="No patterns found containing: " + val), True, False, go.nil, go.nil)
    else:
        if not TheSim.IsRunning:
            TheSim.IsRunning = True
            print("testing index: %s" % idxs[0])
            TheSim.TestItem(idxs[0])
            TheSim.IsRunning = False
            vp.SetNeedsFullRender()