mailr20371 - /branches/relax_disp/test_suite/system_tests/relax_disp.py


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

Header


Content

Posted by edward on July 17, 2013 - 18:53:
Author: bugman
Date: Wed Jul 17 18:53:50 2013
New Revision: 20371

URL: http://svn.gna.org/viewcvs/relax?rev=20371&view=rev
Log:
Simplified the test_hansen_cpmg_data_*() system tests by shifting most shared 
code into setup_hansen_cpmg_data().


Modified:
    branches/relax_disp/test_suite/system_tests/relax_disp.py

Modified: branches/relax_disp/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/system_tests/relax_disp.py?rev=20371&r1=20370&r2=20371&view=diff
==============================================================================
--- branches/relax_disp/test_suite/system_tests/relax_disp.py (original)
+++ branches/relax_disp/test_suite/system_tests/relax_disp.py Wed Jul 17 
18:53:50 2013
@@ -56,6 +56,37 @@
 
         # Reset the relax data storage object.
         ds.__reset__()
+
+
+    def setup_hansen_cpmg_data(self, model=None):
+        """Set up the data for the test_hansen_cpmg_data_*() system tests.
+
+        @keyword model: The name of the model which will be tested.
+        @type model:    str
+        """
+
+        # Create the data pipe and load the base data.
+        data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen'
+        self.interpreter.pipe.create(pipe_name='base pipe', 
pipe_type='relax_disp')
+        self.interpreter.results.read(data_path+sep+'base_pipe')
+
+        # Set the nuclear isotope data.
+        self.interpreter.spin.isotope('15N')
+
+        # Create the R2eff data pipe and load the results.
+        self.interpreter.pipe.create(pipe_name='R2eff', 
pipe_type='relax_disp')
+        self.interpreter.pipe.switch(pipe_name='R2eff')
+        self.interpreter.results.read(data_path+sep+'r2eff_pipe')
+
+        # The model data pipe.
+        self.interpreter.pipe.copy(pipe_from='base pipe', pipe_to=model, 
bundle_to='relax_disp')
+        self.interpreter.pipe.switch(pipe_name=model)
+
+        # Set the model.
+        self.interpreter.relax_disp.select_model(model=model)
+
+        # Copy the data.
+        self.interpreter.value.copy(pipe_from='R2eff', pipe_to=model, 
param='r2eff')
 
 
     def test_hansen_cpmg_data_auto_analysis(self):
@@ -137,28 +168,8 @@
         This uses the data from Dr. Flemming Hansen's paper at 
http://dx.doi.org/10.1021/jp074793o.  This is CPMG data with a fixed 
relaxation time period.
         """
 
-        # Create the data pipe and load the base data.
-        data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen'
-        self.interpreter.pipe.create(pipe_name='base pipe', 
pipe_type='relax_disp')
-        self.interpreter.results.read(data_path+sep+'base_pipe')
-
-        # Set the nuclear isotope data.
-        self.interpreter.spin.isotope('15N')
-
-        # Create the R2eff data pipe and load the results.
-        self.interpreter.pipe.create(pipe_name='R2eff', 
pipe_type='relax_disp')
-        self.interpreter.pipe.switch(pipe_name='R2eff')
-        self.interpreter.results.read(data_path+sep+'r2eff_pipe')
-
-        # The LM63 model data pipe.
-        self.interpreter.pipe.copy(pipe_from='base pipe', pipe_to='LM63', 
bundle_to='relax_disp')
-        self.interpreter.pipe.switch(pipe_name='LM63')
-
-        # Set the model.
-        self.interpreter.relax_disp.select_model(model='LM63')
-
-        # Copy the data.
-        self.interpreter.value.copy(pipe_from='R2eff', pipe_to='LM63', 
param='r2eff')
+        # Base data setup.
+        self.setup_hansen_cpmg_data(model='LM63')
 
         # Alias the spins.
         spin70 = cdp.mol[0].res[0].spin[0]
@@ -206,28 +217,8 @@
         This uses the data from Dr. Flemming Hansen's paper at 
http://dx.doi.org/10.1021/jp074793o.  This is CPMG data with a fixed 
relaxation time period.
         """
 
-        # Create the data pipe and load the base data.
-        data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen'
-        self.interpreter.pipe.create(pipe_name='base pipe', 
pipe_type='relax_disp')
-        self.interpreter.results.read(data_path+sep+'base_pipe')
-
-        # Set the nuclear isotope data.
-        self.interpreter.spin.isotope('15N')
-
-        # Create the R2eff data pipe and load the results.
-        self.interpreter.pipe.create(pipe_name='R2eff', 
pipe_type='relax_disp')
-        self.interpreter.pipe.switch(pipe_name='R2eff')
-        self.interpreter.results.read(data_path+sep+'r2eff_pipe')
-
-        # The CR72 model data pipe.
-        self.interpreter.pipe.copy(pipe_from='base pipe', pipe_to='CR72', 
bundle_to='relax_disp')
-        self.interpreter.pipe.switch(pipe_name='CR72')
-
-        # Set the model.
-        self.interpreter.relax_disp.select_model(model='CR72')
-
-        # Copy the data.
-        self.interpreter.value.copy(pipe_from='R2eff', pipe_to='CR72', 
param='r2eff')
+        # Base data setup.
+        self.setup_hansen_cpmg_data(model='CR72')
 
         # Alias the spins.
         spin70 = cdp.mol[0].res[0].spin[0]
@@ -278,28 +269,8 @@
         This uses the data from Dr. Flemming Hansen's paper at 
http://dx.doi.org/10.1021/jp074793o.  This is CPMG data with a fixed 
relaxation time period.
         """
 
-        # Create the data pipe and load the base data.
-        data_path = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'Hansen'
-        self.interpreter.pipe.create(pipe_name='base pipe', 
pipe_type='relax_disp')
-        self.interpreter.results.read(data_path+sep+'base_pipe')
-
-        # Set the nuclear isotope data.
-        self.interpreter.spin.isotope('15N')
-
-        # Create the R2eff data pipe and load the results.
-        self.interpreter.pipe.create(pipe_name='R2eff', 
pipe_type='relax_disp')
-        self.interpreter.pipe.switch(pipe_name='R2eff')
-        self.interpreter.results.read(data_path+sep+'r2eff_pipe')
-
-        # The IT99 model data pipe.
-        self.interpreter.pipe.copy(pipe_from='base pipe', pipe_to='IT99', 
bundle_to='relax_disp')
-        self.interpreter.pipe.switch(pipe_name='IT99')
-
-        # Set the model.
-        self.interpreter.relax_disp.select_model(model='IT99')
-
-        # Copy the data.
-        self.interpreter.value.copy(pipe_from='R2eff', pipe_to='IT99', 
param='r2eff')
+        # Base data setup.
+        self.setup_hansen_cpmg_data(model='IT99')
 
         # Alias the spins.
         spin70 = cdp.mol[0].res[0].spin[0]




Related Messages


Powered by MHonArc, Updated Wed Jul 17 19:20:01 2013