mailr18226 - in /trunk/test_suite: shared_data/align_data/pcs_dy_200911.txt system_tests/pcs.py


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

Header


Content

Posted by edward on January 18, 2013 - 16:10:
Author: bugman
Date: Fri Jan 18 16:10:14 2013
New Revision: 18226

URL: http://svn.gna.org/viewcvs/relax?rev=18226&view=rev
Log:
Created the Pcs.test_load_multi_col_data system test to demonstrate a failure 
of PCS data loading.

This is a problem when 15N data is in one column and 1H data is in another, 
and the spin_id argument
is used to specify which is which.


Added:
    trunk/test_suite/shared_data/align_data/pcs_dy_200911.txt   (with props)
Modified:
    trunk/test_suite/system_tests/pcs.py

Added: trunk/test_suite/shared_data/align_data/pcs_dy_200911.txt
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/align_data/pcs_dy_200911.txt?rev=18226&view=auto
==============================================================================
--- trunk/test_suite/shared_data/align_data/pcs_dy_200911.txt (added)
+++ trunk/test_suite/shared_data/align_data/pcs_dy_200911.txt Fri Jan 18 
16:10:14 2013
@@ -1,0 +1,3 @@
+#res_num N_pcs      H_pcs       error
+3        0.917       0.843      0.1
+4        1.131       1.279      0.1

Propchange: trunk/test_suite/shared_data/align_data/pcs_dy_200911.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/test_suite/system_tests/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/pcs.py?rev=18226&r1=18225&r2=18226&view=diff
==============================================================================
--- trunk/test_suite/system_tests/pcs.py (original)
+++ trunk/test_suite/system_tests/pcs.py Fri Jan 18 16:10:14 2013
@@ -34,6 +34,41 @@
 
 class Pcs(SystemTestCase):
     """Class for testing PCS operations."""
+
+    def test_load_multi_col_data(self):
+        """Test the loading of PCS data from a file with different columns 
for each spin type."""
+
+        # Create a data pipe for all the data.
+        self.interpreter.pipe.create('CaM N-dom', 'N-state')
+
+        # Create some spins.
+        self.interpreter.spin.create(spin_name='N', spin_num=1, 
res_name='Gly', res_num=3)
+        self.interpreter.spin.create(spin_name='H', spin_num=2, 
res_name='Gly', res_num=3)
+        self.interpreter.spin.create(spin_name='N', spin_num=3, 
res_name='Gly', res_num=4)
+        self.interpreter.spin.create(spin_name='H', spin_num=4, 
res_name='Gly', res_num=4)
+        self.interpreter.sequence.display()
+
+        # Data directory.
+        dir = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep
+
+        # PCSs.
+        self.interpreter.pcs.read(align_id='dy', file='pcs_dy_200911.txt', 
dir=dir, res_num_col=1, data_col=2, error_col=4, spin_id='@N')
+        self.interpreter.pcs.read(align_id='dy', file='pcs_dy_200911.txt', 
dir=dir, res_num_col=1, data_col=3, error_col=4, spin_id='@H')
+
+        # The data.
+        pcs_data = {
+            ':3@N': 0.917,
+            ':3@H': 0.843,
+            ':4@N': 1.131,
+            ':4@H': 1.279,
+        }
+
+        # Check the PCS data.
+        for spin, spin_id in spin_loop(return_id=True):
+            self.assert_(hasattr(spin, 'pcs'))
+            self.assertEqual(spin.pcs['dy'], pcs_data[spin_id])
+            self.assertEqual(spin.pcs_err['dy'], 0.1)
+
 
     def test_pcs_copy(self):
         """Test the operation of the pcs.copy user function."""




Related Messages


Powered by MHonArc, Updated Fri Jan 18 16:20:01 2013