mailr18626 - in /branches/frame_order_testing/test_suite/system_tests: frame_order.py scripts/frame_order/rigid_test.py


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

Header


Content

Posted by edward on March 04, 2013 - 19:21:
Author: bugman
Date: Mon Mar  4 19:21:38 2013
New Revision: 18626

URL: http://svn.gna.org/viewcvs/relax?rev=18626&view=rev
Log:
Created 8 frame order system tests for the rigid test molecule.


Added:
    
branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/rigid_test.py
      - copied, changed from r18625, 
branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py
Modified:
    branches/frame_order_testing/test_suite/system_tests/frame_order.py

Modified: branches/frame_order_testing/test_suite/system_tests/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/system_tests/frame_order.py?rev=18626&r1=18625&r2=18626&view=diff
==============================================================================
--- branches/frame_order_testing/test_suite/system_tests/frame_order.py 
(original)
+++ branches/frame_order_testing/test_suite/system_tests/frame_order.py Mon 
Mar  4 19:21:38 2013
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2006-2012 Edward d'Auvergne                                  
 #
+# Copyright (C) 2006-2013 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -1126,3 +1126,107 @@
 
         # Check the surrounding space.
         self.space_probe(ref_chi2=chi2, params=['ave_pos_alpha', 
'ave_pos_beta', 'ave_pos_gamma', 'eigen_alpha', 'eigen_beta', 'eigen_gamma', 
'cone_theta_x', 'cone_theta_y'])
+
+
+    def test_rigid_data_to_free_rotor_model(self):
+        """Test the free rotor target function for the data from a rigid 
test molecule."""
+
+        # Set the model.
+        ds.model = 'free rotor'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 94337.6680299)
+
+
+    def test_rigid_data_to_iso_cone_model(self):
+        """Test the iso cone target function for the data from a rigid test 
molecule."""
+
+        # Set the model.
+        ds.model = 'iso cone'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 175.440396354)
+
+
+    def test_rigid_data_to_iso_cone_free_rotor_model(self):
+        """Test the iso cone, free rotor target function for the data from a 
rigid test molecule."""
+
+        # Set the model.
+        ds.model = 'iso cone, free rotor'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 101224.40327)
+
+
+    def test_rigid_data_to_iso_cone_torsionless_model(self):
+        """Test the iso cone, torsionless target function for the data from 
a rigid test molecule."""
+
+        # Set the model.
+        ds.model = 'iso cone, torsionless'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 2.80180329697)
+
+
+    def test_rigid_data_to_rigid_model(self):
+        """Test the rigid target function for the data from a rigid test 
molecule."""
+
+        # Set the model.
+        ds.model = 'rigid'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 0.0113763520134)
+
+
+    def test_rigid_data_to_rotor_model(self):
+        """Test the rotor target function for the data from a rigid test 
molecule."""
+
+        # Set the model.
+        ds.model = 'rotor'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 0.968768022709)
+
+
+    def test_rigid_data_to_pseudo_ellipse_model(self):
+        """Test the pseudo-ellipse target function for the data from a rigid 
test molecule."""
+
+        # Set the model.
+        ds.model = 'pseudo-ellipse'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 175.440396354)
+
+
+    def test_rigid_data_to_pseudo_ellipse_torsionless_model(self):
+        """Test the pseudo-ellipse, torsionless target function for the data 
from a rigid test molecule."""
+
+        # Set the model.
+        ds.model = 'pseudo-ellipse, torsionless'
+
+        # Execute the script.
+        self.script_exec(status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'frame_order'+sep+'rigid_test.py')
+
+        # Check the chi2 value.
+        self.assertAlmostEqual(cdp.chi2, 2.80180329697)

Copied: 
branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/rigid_test.py
 (from r18625, 
branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/rigid_test.py?p2=branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/rigid_test.py&p1=branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py&r1=18625&r2=18626&rev=18626&view=diff
==============================================================================
--- 
branches/frame_order_testing/test_suite/shared_data/frame_order/displacements/rigid_test.py
 (original)
+++ 
branches/frame_order_testing/test_suite/system_tests/scripts/frame_order/rigid_test.py
 Mon Mar  4 19:21:38 2013
@@ -28,13 +28,22 @@
 
 # Python module imports.
 from numpy import array, float64
+from os import sep
+
+# relax module imports.
+from data import Relax_data_store; ds = Relax_data_store()
+from status import Status; status = Status()
+
+
+# The data path.
+PATH = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'frame_order'+sep+'displacements'
 
 
 # Create the data pipe.
 pipe.create(pipe_name='rigid test', pipe_type='frame order')
 
 # Read the structures.
-structure.read_pdb('displaced.pdb', set_mol_name='fancy_mol')
+structure.read_pdb('displaced.pdb', dir=PATH, set_mol_name='fancy_mol')
 
 # Set up the 15N and 1H spins.
 structure.load_spins()
@@ -68,10 +77,10 @@
 # Loop over the alignments.
 for i in range(len(ln)):
     # Load the RDCs.
-    rdc.read(align_id=ln[i], file=rdc_files[i], dir='.', spin_id1_col=1, 
spin_id2_col=2, data_col=3, error_col=4)
+    rdc.read(align_id=ln[i], file=rdc_files[i], dir=PATH, spin_id1_col=1, 
spin_id2_col=2, data_col=3, error_col=4)
 
     # The PCS (only a subset of ~5 spins for fast initial optimisations).
-    pcs.read(align_id=ln[i], file=pcs_files[i], dir='.', mol_name_col=1, 
res_num_col=2, spin_name_col=5, data_col=6, error_col=7)
+    pcs.read(align_id=ln[i], file=pcs_files[i], dir=PATH, mol_name_col=1, 
res_num_col=2, spin_name_col=5, data_col=6, error_col=7)
 
     # The temperature and field strength.
     temperature(id=ln[i], temp=303.0)
@@ -143,17 +152,12 @@
 cdp.cone_theta_y = 0.1
 cdp.cone_sigma_max = 0.1
 
-# Loop over all frame order models, showing that they should all have a 
chi-squared close to zero.
-for model in ['rigid', 'free rotor', 'rotor', 'iso cone, torsionless', 'iso 
cone, free rotor', 'iso cone', 'pseudo-ellipse, torsionless', 
'pseudo-ellipse']:
-    # Print out.
-    text = "# Model: %s" % model
-    print("\n\n%s\n%s" % (text, '#'*len(text)))
+# Allow for stand-alone operation.
+if not hasattr(ds, 'model'):
+    ds.model = 'rigid'
 
-    # Select the Frame Order model.
-    frame_order.select_model(model=model)
+# Select the Frame Order model.
+frame_order.select_model(model=ds.model)
 
-    # Calculate the chi2 value.
-    calc()
-
-    # Attempt to mimimise.
-    #minimise('simplex', constraints=False)
+# Calculate the chi2 value.
+calc()




Related Messages


Powered by MHonArc, Updated Tue Mar 05 11:00:02 2013