mailr17147 - in /branches/interatomic/test_suite/system_tests: angles.py scripts/angles.py


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

Header


Content

Posted by edward on July 03, 2012 - 09:29:
Author: bugman
Date: Tue Jul  3 09:29:26 2012
New Revision: 17147

URL: http://svn.gna.org/viewcvs/relax?rev=17147&view=rev
Log:
Converted the Angles.test_angles() system test and associated script to the 
interatomic data design.


Modified:
    branches/interatomic/test_suite/system_tests/angles.py
    branches/interatomic/test_suite/system_tests/scripts/angles.py

Modified: branches/interatomic/test_suite/system_tests/angles.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/test_suite/system_tests/angles.py?rev=17147&r1=17146&r2=17147&view=diff
==============================================================================
--- branches/interatomic/test_suite/system_tests/angles.py (original)
+++ branches/interatomic/test_suite/system_tests/angles.py Tue Jul  3 
09:29:26 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2006-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2006-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -26,6 +26,7 @@
 # relax module imports.
 from base_classes import SystemTestCase
 from data import Relax_data_store; ds = Relax_data_store()
+from generic_fns.interatomic import return_interatom_list
 from status import Status; status = Status()
 
 
@@ -70,24 +71,29 @@
             # Check the residue and spin info.
             self.assertEqual(cdp.mol[0].res[i].num, i+1)
             self.assertEqual(cdp.mol[0].res[i].name, res_name[i])
-            self.assertEqual(len(cdp.mol[0].res[i].spin), 1)
             self.assertEqual(cdp.mol[0].res[i].spin[0].num, spin_num[i])
             self.assertEqual(cdp.mol[0].res[i].spin[0].name, spin_name[i])
 
-            # Angles have been calculated.
-            if hasattr(cdp.mol[0].res[i].spin[0], 'attached_atom'):
-                # The attached proton.
-                self.assertEqual(cdp.mol[0].res[i].spin[0].attached_atom, 
attached_atoms[i])
+            # Get the interatomic container.
+            interatoms = 
return_interatom_list(cdp.mol[0].res[i].spin[0]._spin_ids[0])
 
-                # The XH vector.
+            # Check the containers.
+            self.assert_(len(interatoms) <= 1)
+
+            # No interatomic container.
+            if not interatoms:
+                # The spin info.
+                self.assertEqual(len(cdp.mol[0].res[i].spin), 1)
+
+            # Check the interatomic info.
+            else:
+                # The spin info.
+                self.assertEqual(len(cdp.mol[0].res[i].spin), 2)
+                self.assertEqual(cdp.mol[0].res[i].spin[1].name, 
attached_atoms[i])
+
+                # The vector.
                 for j in xrange(3):
-                    
self.assertAlmostEqual(cdp.mol[0].res[i].spin[0].xh_vect[j], xh_vects[i][j])
+                    self.assertAlmostEqual(interatoms[0].vector[j], 
xh_vects[i][j])
 
                 # Check the alpha angles.
-                self.assertAlmostEqual(cdp.mol[0].res[i].spin[0].alpha, 
alpha[i])
-
-            # No angles calculated.
-            else:
-                self.assertEqual(attached_atoms[i], None)
-                self.assert_(not hasattr(cdp.mol[0].res[i].spin[0], 
'xh_vect'))
-                self.assert_(not hasattr(cdp.mol[0].res[i].spin[0], 'alpha'))
+                self.assertAlmostEqual(interatoms[0].alpha, alpha[i])

Modified: branches/interatomic/test_suite/system_tests/scripts/angles.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/test_suite/system_tests/scripts/angles.py?rev=17147&r1=17146&r2=17147&view=diff
==============================================================================
--- branches/interatomic/test_suite/system_tests/scripts/angles.py (original)
+++ branches/interatomic/test_suite/system_tests/scripts/angles.py Tue Jul  3 
09:29:26 2012
@@ -14,9 +14,11 @@
 
 # Load the spins.
 structure.load_spins('@N')
+structure.load_spins('@H')
 
 # Set the NH vector.
-structure.vectors(attached='H')
+dipole_pair.define('@N', '@H')
+dipole_pair.unit_vectors()
 
 # Initialise a diffusion tensor.
 diffusion_tensor.init((1.698e7, 1.417e7, 67.174, -83.718), param_types=3)




Related Messages


Powered by MHonArc, Updated Tue Jul 03 09:40:03 2012