Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

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

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

revision 3945, Thu Jun 9 20:00:15 2016 UTC revision 3946, Sat Jun 11 00:39:19 2016 UTC
# Line 3  Line 3
3  from obj_operator import *  from obj_operator import *
4
5  def toStr(name,var, maxdiff,maxerr):  def toStr(name,var, maxdiff,maxerr):
6      f = open("results_tmp.txt", 'a+')      # f = open("results_tmp.txt", 'a+')
7      f.write("\n\n **********")      #f.write("\n\n **********")
8      #print (name)      #print (name)
9      x=(" max diff: "+str( maxdiff))      x=(" max diff: "+str( maxdiff))
10      #print "x",x      #print "x",x
11      f.write(name)      #f.write(name)
12      if (maxdiff<=0.01):      if (maxdiff<=0.01):
13          rtn = "Results: "+var+": good"          rtn = "Results: "+var+": good"
14          f.write("\n\t\t"+rtn)          #   f.write("\n\t\t"+rtn)
15          f.close()          #f.close()
16          print rtn          print rtn
17          return rtn          return (rtn,1,0,0,0)
18      elif (maxdiff<=0.1):      elif (maxdiff<=0.1):
19          rtn = "Results: "+var+": eh "+x          rtn = "Results: "+var+": eh "+x
20          f.write("\n\t\t"+rtn)          #f.write("\n\t\t"+rtn)
21          f.close()          #f.close()
22          print rtn          print rtn
23          return rtn          return (rtn,0,1,0,0)
24      else:      else:
25          rtn = "Results: "+var+": terrible "+x          rtn = "Results: "+var+": terrible "+x
26          f.write("\n\t\t"+rtn)          #f.write("\n\t\t"+rtn)
27          f.close()          #f.close()
28          print rtn          print rtn
29          return rtn          return (rtn,0,0,1,0)
30  #difference and error between observed data and correct data  #difference and error between observed data and correct data
31  #output is length 1  #output is length 1
32  def checkdiff_1(name, obv, cor):  def checkdiff_1(name, obv, cor):

Legend:
 Removed from v.3945 changed lines Added in v.3946