Author: bugman
Date: Mon Sep 22 09:59:35 2014
New Revision: 25942

URL: http://svn.gna.org/viewcvs/relax?rev=25942&view=rev
Log:
Created the Structure.test_collapse_ensemble system test.

This is used to test a planned feature of the internal structural object.  The 
collapse_ensemble()
method will be created to remove all but one model in the structural ensemble.


Modified:
    trunk/test_suite/system_tests/structure.py

Modified: trunk/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=25942&r1=25941&r2=25942&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py  (original)
+++ trunk/test_suite/system_tests/structure.py  Mon Sep 22 09:59:35 2014
@@ -243,6 +243,33 @@
 
         # Superimpose.
         self.interpreter.structure.superimpose(method='fit to first', 
centre_type='CoM')
+
+
+    def test_collapse_ensemble(self):
+        """Test the collapse_ensemble() method of the internal structural 
object."""
+
+        # Create 2 models.
+        self.interpreter.structure.add_model(model_num=1)
+        self.interpreter.structure.add_model(model_num=2)
+
+        # Add an atom.
+        self.interpreter.structure.add_atom(atom_name='H', res_name='Gly', 
res_num=1, pos=[[0.0, 1.0, 2.0], [1.0, 2.0, 3.0]], element='H')
+
+        # Collapse the ensemble to the 2nd model.
+        cdp.structure.collapse_ensemble(model_num=2, model_to=1)
+
+        # Check the collapsed ensemble.
+        self.assert_(hasattr(cdp, 'structure'))
+        self.assertEqual(len(cdp.structure.structural_data), 1)
+        self.assertEqual(cdp.structure.structural_data[0].num, 1)
+        self.assertEqual(len(cdp.structure.structural_data[0].mol), 1)
+
+        # Check the atomic data.
+        mol = cdp.structure.structural_data[0].mol[0]
+        self.assertEqual(len(mol.atom_name), 1)
+        self.assertEqual(mol.x[0], 1.0)
+        self.assertEqual(mol.y[0], 2.0)
+        self.assertEqual(mol.z[0], 3.0)
 
 
     def test_create_diff_tensor_pdb(self):


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to