mailr13414 - /branches/xyz/test_suite/system_tests/structure.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by hasu on July 04, 2011 - 14:27:
Author: han87
Date: Mon Jul  4 14:27:05 2011
New Revision: 13414

URL: http://svn.gna.org/viewcvs/relax?rev=13414&view=rev
Log:
The system test for loading a single spin from a xyz has been changed.

The function return_spin() from the 'mol_res_spin' has been used to load a 
single spin for the system test 'test_read_xyz_internal2'.

Modified:
    branches/xyz/test_suite/system_tests/structure.py

Modified: branches/xyz/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/xyz/test_suite/system_tests/structure.py?rev=13414&r1=13413&r2=13414&view=diff
==============================================================================
--- branches/xyz/test_suite/system_tests/structure.py (original)
+++ branches/xyz/test_suite/system_tests/structure.py Mon Jul  4 14:27:05 2011
@@ -26,7 +26,7 @@
 # relax module imports.
 from base_classes import SystemTestCase
 from data import Relax_data_store; ds = Relax_data_store()
-from generic_fns.mol_res_spin import count_spins
+from generic_fns.mol_res_spin import count_spins, return_spin
 from status import Status; status = Status()
 
 
@@ -656,7 +656,7 @@
         path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'structures'
 
         # Read the xyz.
-        
self.interpreter.structure.read_xyz(file='SSS-cluster4-new-test.xyz', 
dir=path, read_model=[1,3])
+        
self.interpreter.structure.read_xyz(file='SSS-cluster4-new-test.xyz', 
dir=path, read_model=[1])
 
         # Test the molecule name.
         self.assertEqual(cdp.structure.structural_data[0].mol[0].mol_name, 
'SSS-cluster4-new-test_mol1')
@@ -666,18 +666,10 @@
         self.assertEqual(count_spins(), 1)
 
         # Test the spin coordinates.
-        mol = cdp.structure.structural_data[0].mol[0]
-        last_spin_x=[]
-        last_spin_y=[]
-        last_spin_z=[]
-        for i in xrange(len(mol.atom_num)):
-            last_spin_x.append(mol.x[i])
-            last_spin_y.append(mol.y[i])
-            last_spin_z.append(mol.z[i])
-        
-        self.assertEqual(last_spin_x[160], -9.947)
-        self.assertEqual(last_spin_y[160], -6.062)
-        self.assertEqual(last_spin_z[160], 11.682)
+        a=return_spin('#SSS-cluster4-new-test_mol1@2')
+        self.assertAlmostEqual(a.pos[0], -12.398)
+        self.assertAlmostEqual(a.pos[1], -15.992)
+        self.assertAlmostEqual(a.pos[2], 11.448)
 
         # Try loading a few protons.
         #self.interpreter.structure.load_spins('@H')




Related Messages


Powered by MHonArc, Updated Mon Jul 04 14:40:02 2011