/[ascend]/branches/fprops2/test.py
ViewVC logotype

Diff of /branches/fprops2/test.py

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

revision 1379 by jpye, Sat Mar 31 02:41:26 2007 UTC revision 1380 by jpye, Fri Apr 6 04:07:32 2007 UTC
# Line 293  class TestCMSlv(AscendSelfTester): Line 293  class TestCMSlv(AscendSelfTester):
293  class TestMatrix(AscendSelfTester):  class TestMatrix(AscendSelfTester):
294      def testlog10(self):      def testlog10(self):
295          M = self._run('testlog10')          M = self._run('testlog10')
296          print M.getMatrix().write(sys.stderr,"mmio")          print "FETCHING MATRIX................."
297            X = M.getMatrix()
298    # this stuff crashes Windows because the FILE* structure used by Python is not the same
299    # as used by MinGW...
300            #print "GOT MATRIX"
301            #sys.stderr.flush()
302            #sys.stdout.flush()
303            #F = os.tmpfile()
304            #X.write(F.fileno,"mmio")
305            #F.seek(0)
306            #print F.read()
307                    
308  class TestIntegrator(Ascend):  class TestIntegrator(Ascend):
309    
# Line 1001  class TestIDA(Ascend): Line 1010  class TestIDA(Ascend):
1010          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
1011          I.setEngine('IDA')          I.setEngine('IDA')
1012          I.analyse()          I.analyse()
1013          F = os.tmpfile()  # this stuff fails on Windows because FILE structure is different python vs mingw
1014          I.writeMatrix(F,"dF/dy")  #       F = os.tmpfile()
1015          F.seek(0)  #       I.writeMatrix(F,"dF/dy")
1016          print F.read()  #       F.seek(0)
1017          F1 = os.tmpfile()  #       print F.read()
1018          I.writeMatrix(F1,"dF/dy'")  #       F1 = os.tmpfile()
1019          F1.seek(0)  #       I.writeMatrix(F1,"dF/dy'")
1020          print F1.read()  #       F1.seek(0)
1021          F1 = os.tmpfile()  #       print F1.read()
1022          I.writeMatrix(F1,"dg/dx")  #       F1 = os.tmpfile()
1023          F1.seek(0)  #       I.writeMatrix(F1,"dg/dx")
1024          print F1.read()  #       F1.seek(0)
1025          # for the moment you'll have to check these results manually.  #       print F1.read()
1026    #       # for the moment you'll have to check these results manually.
1027    
1028      def testwritematrix2(self):      def testwritematrix2(self):
1029          self.L.load('test/ida/writematrix.a4c')          self.L.load('test/ida/writematrix.a4c')
# Line 1023  class TestIDA(Ascend): Line 1033  class TestIDA(Ascend):
1033          I = ascpy.Integrator(M)          I = ascpy.Integrator(M)
1034          I.setEngine('IDA')          I.setEngine('IDA')
1035          I.analyse()          I.analyse()
1036          F = os.tmpfile()  # this stuff fails on Windows because FILE structure is different python vs mingw
1037          I.writeMatrix(F,"dF/dy")  #       F = os.tmpfile()
1038          F.seek(0)  #       I.writeMatrix(F,"dF/dy")
1039          print F.read()  #       F.seek(0)
1040          F1 = os.tmpfile()  #       print F.read()
1041          I.writeMatrix(F1,"dF/dy'")  #       F1 = os.tmpfile()
1042          F1.seek(0)  #       I.writeMatrix(F1,"dF/dy'")
1043          print F1.read()  #       F1.seek(0)
1044          F1 = os.tmpfile()  #       print F1.read()
1045          I.writeMatrix(F1,"dg/dx")  #       F1 = os.tmpfile()
1046          F1.seek(0)  #       I.writeMatrix(F1,"dg/dx")
1047          print F1.read()  #       F1.seek(0)
1048    #       print F1.read()
1049          #F1 = os.tmpfile()          #F1 = os.tmpfile()
1050          #I.writeMatrix(F1,"dydp/dyd")          #I.writeMatrix(F1,"dydp/dyd")
1051          #F1.seek(0)          #F1.seek(0)
# Line 1407  if __name__=='__main__': Line 1418  if __name__=='__main__':
1418              restart = 1              restart = 1
1419    
1420      if restart:      if restart:
1421          script = os.path.join(sys.path[0],"test.py")                              if platform.system()=="Windows":
1422          print "Restarting with..."              pass
1423          print "  export LD_LIBRARY_PATH=%s" % os.environ.get(LD_LIBRARY_PATH)          else:
1424          print "  export PYTHONPATH=%s" % os.environ.get('PYTHONPATH')              script = os.path.join(sys.path[0],"test.py")                    
1425          print "  export ASCENDLIBRARY=%s" % os.environ.get('ASCENDLIBRARY')              sys.stderr.write("Restarting with...\n")
1426                sys.stderr.write("  export LD_LIBRARY_PATH=%s\n" % os.environ.get(LD_LIBRARY_PATH))
1427          os.execvp("python",[script] + sys.argv)              sys.stderr.write("  export PYTHONPATH=%s\n" % os.environ.get('PYTHONPATH'))
1428                sys.stderr.write("  export ASCENDLIBRARY=%s\n" % os.environ.get('ASCENDLIBRARY'))
1429                sys.stderr.flush()
1430                os.execvp("python",[script] + sys.argv)
1431    
1432      import ascpy      import ascpy
1433    

Legend:
Removed from v.1379  
changed lines
  Added in v.1380

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