/[ascend]/trunk/pygtk/test.py
ViewVC logotype

Diff of /trunk/pygtk/test.py

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

revision 944 by johnpye, Sat Nov 25 10:46:13 2006 UTC revision 945 by johnpye, Sat Nov 25 12:41:03 2006 UTC
# Line 84  class AscendTest(unittest.TestCase): Line 84  class AscendTest(unittest.TestCase):
84          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
85          I.setEngine('IDA')          I.setEngine('IDA')
86          P = I.getParameters()          P = I.getParameters()
87          assert len(P)==2          for p in P:
88          assert P[0].isBool()              print p.getName(),"=",p.getValue()
89          assert P[0].getName()=="autodiff"          assert len(P)==5
90          assert P[0].getBoolValue() == True          assert P[0].isStr()
91          assert P[1].getName()=="useatol"          assert P[0].getName()=="linsolver"
92          assert P[1].getBoolValue() == True          assert P[0].getValue()=='DENSE'
93          P[0].setBoolValue(False)          assert P[1].getName()=="autodiff"
94          assert P[0].getBoolValue()==False          assert P[1].getValue()==True
95            assert P[4].getName()=="atolvect"
96            assert P[4].getBoolValue() == True
97            P[1].setBoolValue(False)
98            assert P[1].getBoolValue()==False
99          I.setParameters(P)          I.setParameters(P)
         assert len(I.getParameters())==2  
100          for p in I.getParameters():          for p in I.getParameters():
101              print p.getName(),"=",p.getValue()              print p.getName(),"=",p.getValue()
102          assert I.getParameterValue('autodiff')==False          assert I.getParameterValue('autodiff')==False
# Line 111  class AscendTest(unittest.TestCase): Line 114  class AscendTest(unittest.TestCase):
114          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
115          I.setEngine('IDA')          I.setEngine('IDA')
116          I.setReporter(ascpy.IntegratorReporterConsole(I))          I.setReporter(ascpy.IntegratorReporterConsole(I))
117          I.setLogTimesteps(ascpy.Units("s"), 0.2, 4e10, 21);          I.setLogTimesteps(ascpy.Units("s"), 0.4, 4e10, 11);
118          I.setMinSubStep(0.0005); # these limits are required by IDA at present (numeric diff)          I.setMinSubStep(0.0005); # these limits are required by IDA at present (numeric diff)
119          I.setMaxSubStep(0.02);          I.setMaxSubStep(0.02);
120          I.setInitialSubStep(0.001);          I.setInitialSubStep(0.001);
121          I.setMaxSubSteps(500);          I.setMaxSubSteps(500);
122          I.setParameter('autodiff',True)          I.setParameter('autodiff',True)
123            I.setParameter('linsolver','SPGMR')
124          I.analyse()          I.analyse()
125          I.solve()          I.solve()
126            self.fail("WHAT IS THE ANSWER?")
127    
128  # move code above down here if you want to temporarily avoid testing it  # move code above down here if you want to temporarily avoid testing it
129  class NotToBeTested:  class NotToBeTested:

Legend:
Removed from v.944  
changed lines
  Added in v.945

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22