mailr18142 - in /trunk/test_suite/system_tests: __init__.py pcs.py


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

Header


Content

Posted by edward on December 14, 2012 - 17:51:
Author: bugman
Date: Fri Dec 14 17:51:48 2012
New Revision: 18142

URL: http://svn.gna.org/viewcvs/relax?rev=18142&view=rev
Log:
Created the Pcs.test_pcs_load and Pcs.test_pcs_copy system tests to check 
some of the PCS user functions.

The Pcs system test class is new, and these tests check untested areas of 
relax.


Added:
    trunk/test_suite/system_tests/pcs.py
      - copied, changed from r18140, trunk/test_suite/system_tests/rdc.py
Modified:
    trunk/test_suite/system_tests/__init__.py

Modified: trunk/test_suite/system_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/__init__.py?rev=18142&r1=18141&r2=18142&view=diff
==============================================================================
--- trunk/test_suite/system_tests/__init__.py (original)
+++ trunk/test_suite/system_tests/__init__.py Fri Dec 14 17:51:48 2012
@@ -52,6 +52,7 @@
 from test_suite.system_tests.noe import Noe
 from test_suite.system_tests.noe_restraints import Noe_restraints
 from test_suite.system_tests.palmer import Palmer
+from test_suite.system_tests.pcs import Pcs
 from test_suite.system_tests.peak_lists import Peak_lists
 from test_suite.system_tests.pipes import Pipes
 from test_suite.system_tests.rdc import Rdc
@@ -84,6 +85,7 @@
            'noe',
            'noe_restraints',
            'palmer',
+           'pcs'
            'peak_lists'
            'pipes',
            'rdc',
@@ -169,6 +171,7 @@
             suite_array.append(TestLoader().loadTestsFromTestCase(Noe))
             
suite_array.append(TestLoader().loadTestsFromTestCase(Noe_restraints))
             suite_array.append(TestLoader().loadTestsFromTestCase(Palmer))
+            suite_array.append(TestLoader().loadTestsFromTestCase(Pcs))
             
suite_array.append(TestLoader().loadTestsFromTestCase(Peak_lists))
             suite_array.append(TestLoader().loadTestsFromTestCase(Pipes))
             suite_array.append(TestLoader().loadTestsFromTestCase(Rdc))

Copied: trunk/test_suite/system_tests/pcs.py (from r18140, 
trunk/test_suite/system_tests/rdc.py)
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/pcs.py?p2=trunk/test_suite/system_tests/pcs.py&p1=trunk/test_suite/system_tests/rdc.py&r1=18140&r2=18142&rev=18142&view=diff
==============================================================================
--- trunk/test_suite/system_tests/rdc.py (original)
+++ trunk/test_suite/system_tests/pcs.py Fri Dec 14 17:51:48 2012
@@ -20,24 +20,23 @@
 
###############################################################################
 
 # Module docstring.
-"""RDC-based system tests."""
+"""PCS-based system tests."""
 
 
 # Python module imports.
 from os import sep
 
 # relax module imports.
-from generic_fns.interatomic import interatomic_loop
-from generic_fns.mol_res_spin import count_spins
+from generic_fns.mol_res_spin import count_spins, spin_loop
 from status import Status; status = Status()
 from test_suite.system_tests.base_classes import SystemTestCase
 
 
-class Rdc(SystemTestCase):
-    """Class for testing RDC operations."""
+class Pcs(SystemTestCase):
+    """Class for testing PCS operations."""
 
-    def test_rdc_copy(self):
-        """Test the operation of the rdc.copy user function."""
+    def test_pcs_copy(self):
+        """Test the operation of the pcs.copy user function."""
 
         # Create a data pipe.
         self.interpreter.pipe.create('orig', 'N-state')
@@ -46,38 +45,37 @@
         dir = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep
 
         # Load the spins.
-        self.interpreter.sequence.read(file='tb.txt', dir=dir, spin_id_col=1)
-        self.interpreter.sequence.attach_protons()
+        self.interpreter.sequence.read(file='pcs.txt', dir=dir, 
spin_name_col=1)
         self.interpreter.sequence.display()
 
-        # Load the RDCs.
-        self.interpreter.rdc.read(align_id='tb', file='tb.txt', dir=dir, 
spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4)
+        # Load the PCSs.
+        self.interpreter.pcs.read(align_id='tb', file='pcs.txt', dir=dir, 
spin_name_col=1, data_col=2)
         self.interpreter.sequence.display()
 
-        # The RDCs.
-        rdcs = [ -26.2501958629, 9.93081766942, 7.26317614156, 
-1.24840526981, 5.31803314334, 14.0362909456, 1.33652530397, -1.6021670281]
+        # The PCSs.
+        pcs = [0.004, 0.008, 0.021, 0.029, 0.016, 0.010, 0.008, 0.003, 
0.006, 0.003, 0.007, 0.005, 0.001, 0.070, None, 0.025, 0.098, 0.054, 0.075, 
0.065, None, 0.070, 0.015, 0.098, 0.060, 0.120]
 
         # Create a new data pipe by copying the old, then switch to it.
         self.interpreter.pipe.copy(pipe_from='orig', pipe_to='new')
         self.interpreter.pipe.switch(pipe_name='new')
 
-        # Delete the RDC data.
-        self.interpreter.rdc.delete()
+        # Delete the PCS data.
+        self.interpreter.pcs.delete()
 
-        # Copy the RDCs.
-        self.interpreter.rdc.copy(pipe_from='orig', align_id='tb')
+        # Copy the PCSs.
+        self.interpreter.pcs.copy(pipe_from='orig', align_id='tb')
 
         # Checks.
-        self.assertEqual(count_spins(), 16)
-        self.assertEqual(len(cdp.interatomic), 8)
+        self.assertEqual(count_spins(), 26)
+        self.assertEqual(len(cdp.interatomic), 0)
         i = 0
-        for interatom in interatomic_loop():
-            self.assertAlmostEqual(rdcs[i], interatom.rdc['tb'])
+        for spin in spin_loop():
+            self.assertEqual(pcs[i], spin.pcs['tb'])
             i += 1
 
 
-    def test_rdc_load(self):
-        """Test for the loading of some RDC data with the spin ID format."""
+    def test_pcs_load(self):
+        """Test for the loading of some PCS data with the spin ID format."""
 
         # Create a data pipe.
         self.interpreter.pipe.create('test', 'N-state')
@@ -86,21 +84,20 @@
         dir = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'align_data'+sep
 
         # Load the spins.
-        self.interpreter.sequence.read(file='tb.txt', dir=dir, spin_id_col=1)
-        self.interpreter.sequence.attach_protons()
+        self.interpreter.sequence.read(file='pcs.txt', dir=dir, 
spin_name_col=1)
         self.interpreter.sequence.display()
 
-        # Load the RDCs.
-        self.interpreter.rdc.read(align_id='tb', file='tb.txt', dir=dir, 
spin_id1_col=1, spin_id2_col=2, data_col=3, error_col=4)
+        # Load the PCSs.
+        self.interpreter.pcs.read(align_id='tb', file='pcs.txt', dir=dir, 
spin_name_col=1, data_col=2)
         self.interpreter.sequence.display()
 
-        # The RDCs.
-        rdcs = [ -26.2501958629, 9.93081766942, 7.26317614156, 
-1.24840526981, 5.31803314334, 14.0362909456, 1.33652530397, -1.6021670281]
+        # The PCSs.
+        pcs = [0.004, 0.008, 0.021, 0.029, 0.016, 0.010, 0.008, 0.003, 
0.006, 0.003, 0.007, 0.005, 0.001, 0.070, None, 0.025, 0.098, 0.054, 0.075, 
0.065, None, 0.070, 0.015, 0.098, 0.060, 0.120]
 
         # Checks.
-        self.assertEqual(count_spins(), 16)
-        self.assertEqual(len(cdp.interatomic), 8)
+        self.assertEqual(count_spins(), 26)
+        self.assertEqual(len(cdp.interatomic), 0)
         i = 0
-        for interatom in interatomic_loop():
-            self.assertAlmostEqual(rdcs[i], interatom.rdc['tb'])
+        for spin in spin_loop():
+            self.assertEqual(pcs[i], spin.pcs['tb'])
             i += 1




Related Messages


Powered by MHonArc, Updated Fri Dec 14 18:00:01 2012