Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/test_compare.py
ViewVC logotype

Diff of /branches/ein16/synth/d2/test_compare.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4363, Thu Aug 4 22:42:10 2016 UTC revision 4379, Mon Aug 8 15:55:15 2016 UTC
# Line 19  Line 19 
19      rst_compile = 0      rst_compile = 0
20    
21      if (maxdiff<=0.01):      if (maxdiff<=0.01):
22          rtn = "Results: "+var+": good"          rtn = "Results: "+var+": A "
23          rst_good = 1          rst_good = 1
24          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
25      elif (maxdiff<=0.1):      elif (maxdiff<=0.1):
26          rtn = "Results: "+var+": eh "+x          if(per>10):
27                rtn = "Results: "+var+": p-0 "+s
28                rst_check = 1
29                return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
30            elif(per>1):
31                rtn = "Results: "+var+": p-1 "+s
32                rst_check = 1
33                return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
34            else:
35                rtn = "Results: "+var+": B "+x
36          rst_eh = 1          rst_eh = 1
37          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
38      elif(per>10 and maxdiff>0.1):      else:
39          rtn = "Results: "+var+": terrible "+s          if(per>10):
40                rtn = "Results: "+var+": T-0 "+s
41          rst_terrible = 1          rst_terrible = 1
42          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
43      elif(per>1 and maxdiff>1.0):          elif(per>1):
44          rtn = "Results: "+var+": terrible "+s              rtn = "Results: "+var+": T-1 "+s
45          rst_terrible = 1          rst_terrible = 1
46          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
47      else:          elif(per>0.1):
48          rtn = "Results: "+var+": check "+s              rtn = "Results: "+var+": T-2 "+s
49          rst_check = 1          rst_check = 1
50          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)          return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
51    
52            else:
53                rtn = "Results: "+var+": T-3 "+x
54                rst_eh = 1
55                return (rtn, rst_good, rst_eh, rst_check, rst_terrible, rst_compile)
56    
57    
58  #difference and error between observed data and correct data  #difference and error between observed data and correct data
59  #output is length 1  #output is length 1
60  def checkdiff_1(name, obv, cor):  def checkdiff_1(name, obv, cor):
# Line 68  Line 84 
84      if(o6==0):      if(o6==0):
85          per = 0.0          per = 0.0
86      else:      else:
87          per  = 100*(maxdiff/o6)          per  = abs(100*(maxdiff/o6))
88      avg = sumdiff/length      avg = sumdiff/length
89      s=" max diff: "+str(round(maxdiff,4))+" sumdiff: "+str(round(avg,4))+" "+ str(round(per,4))+"% c:"+str( c6)+ " o:"+str(o6)      s=" max diff: "+str(round(maxdiff,4))+" sumdiff: "+str(round(avg,4))+" "+ str(round(per,4))+"% c:"+str( c6)+ " o:"+str(o6)
90          #print("current maximal difference", maxdiff, "c: ", c, " o:",o)          #print("current maximal difference", maxdiff, "c: ", c, " o:",o)
# Line 115  Line 131 
131      if(o6==0):      if(o6==0):
132          per = 0.0          per = 0.0
133      else:      else:
134          per  = 100*(maxdiff/o6)          per  = abs(100*(maxdiff/o6))
135      avg = sumdiff/length      avg = sumdiff/length
136      s=" max diff: "+str(round(maxdiff,4))+" sumdiff: "+str(round(avg,4))+" "+ str(round(per,4))+"% c:"+str( c6)+ " o:"+str(o6)      s=" max diff: "+str(round(maxdiff,4))+" sumdiff: "+str(round(avg,4))+" "+ str(round(per,4))+"% c:"+str( c6)+ " o:"+str(o6)
137      return toStr(name,"x0", maxdiff,avg, per ,s)      return toStr(name,"x0", maxdiff,avg, per ,s)

Legend:
Removed from v.4363  
changed lines
  Added in v.4379

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0