예제 #1
0
 def read_test(self):
     #test the read output function of macmiallle
     mac = Macmaille('python_code/testdata/test1.hkl',1.541800, 0.0000, 0,'mac_test')
     num1,num2 = mac.read_output('python_code/testdata/mcm_output.imp')
     # are the shapes right?
     assert num1.shape == (5,6)
     assert num2.shape == (5,6)
예제 #2
0
 def read_test(self):
     #test the read output function of macmiallle
     mac = Macmaille('python_code/testdata/test1.hkl', 1.541800, 0.0000, 0,
                     'mac_test')
     num1, num2 = mac.read_output('python_code/testdata/mcm_output.imp')
     # are the shapes right?
     assert num1.shape == (5, 6)
     assert num2.shape == (5, 6)
예제 #3
0
 def write_test(self):
     #Tests the full write functions of write input
     mac = Macmaille('python_code/testdata/test1.hkl',1.541800, 0.0000, 0,'mac_test')
     mac.writeinput('python_code/testdata/')
     with open('python_code/testdata/'+mac.title+'.dat','r') as f:
         with open('python_code/testdata/mac_input_test.txt','r') as g:
             flines  = f.readlines()
             glines = g.readlines()
             for l1,l2 in zip(flines,glines):
                 assert l1 == l2
             g.close()
         f.close()
예제 #4
0
 def write_test(self):
     #Tests the full write functions of write input
     mac = Macmaille('python_code/testdata/test1.hkl', 1.541800, 0.0000, 0,
                     'mac_test')
     mac.writeinput('python_code/testdata/')
     with open('python_code/testdata/' + mac.title + '.dat', 'r') as f:
         with open('python_code/testdata/mac_input_test.txt', 'r') as g:
             flines = f.readlines()
             glines = g.readlines()
             for l1, l2 in zip(flines, glines):
                 assert l1 == l2
             g.close()
         f.close()
예제 #5
0
 def write_test2(self):
     # tests the write function with parameters added 
     mac = Macmaille('python_code/testdata/test1.hkl',1.541800, 0.0000, 0,'mac_test2')
     key_chain = {'Symmetry codes':None,'W': None,'Nind':None,'Pmin':None, 'Pmax':None, 'Vmin':None, 'Vmax':None, 'Rmin':None, 'Rmax':None, 'Rmaxref':None,'Spar':None, 'Sang':None,'Ntests':None, 'Nruns':None}
     for k in key_chain.iterkeys():
         mac.set_keywords(k, 1)
     mac.writeinput('python_code/testdata/')
     with open('python_code/testdata/mac_input_test2.txt','r') as f:
         with open('python_code/testdata/mac_test2.dat', 'r') as g:
             flines = f.readlines()
             glines = g.readlines()
             for l1,l2 in zip(flines,glines):
                 assert l1 == l2
예제 #6
0
 def write_test2(self):
     # tests the write function with parameters added
     mac = Macmaille('python_code/testdata/test1.hkl', 1.541800, 0.0000, 0,
                     'mac_test2')
     key_chain = {
         'Symmetry codes': None,
         'W': None,
         'Nind': None,
         'Pmin': None,
         'Pmax': None,
         'Vmin': None,
         'Vmax': None,
         'Rmin': None,
         'Rmax': None,
         'Rmaxref': None,
         'Spar': None,
         'Sang': None,
         'Ntests': None,
         'Nruns': None
     }
     for k in key_chain.iterkeys():
         mac.set_keywords(k, 1)
     mac.writeinput('python_code/testdata/')
     with open('python_code/testdata/mac_input_test2.txt', 'r') as f:
         with open('python_code/testdata/mac_test2.dat', 'r') as g:
             flines = f.readlines()
             glines = g.readlines()
             for l1, l2 in zip(flines, glines):
                 assert l1 == l2
예제 #7
0
 def call_test(self):
     #tests the call function at the moment this should return 1
     mac = Macmaille('python_code/testdata/test1.hkl', 1.541800, 0.0000, 0,
                     'mac_test')
     assert mac.call() == 1
예제 #8
0
 def call_test(self):
     #tests the call function at the moment this should return 1
     mac = Macmaille('python_code/testdata/test1.hkl',1.541800, 0.0000, 0,'mac_test')
     assert mac.call() == 1