mailr22347 - /trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py


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

Header


Content

Posted by tlinnet on February 26, 2014 - 17:43:
Author: tlinnet
Date: Wed Feb 26 17:43:22 2014
New Revision: 22347

URL: http://svn.gna.org/viewcvs/relax?rev=22347&view=rev
Log:
Added unit test for find_intensity_keys() in R1rho analysis.

Regarding bug #21344, (https://gna.org/bugs/index.php?21344) - Handling of in 
sparse acquired R1rho dataset with missing combinations of time and spin-lock 
field strengths.

Modified:
    
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py

Modified: 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py?rev=22347&r1=22346&r2=22347&view=diff
==============================================================================
--- 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py 
(original)
+++ 
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py 
Wed Feb 26 17:43:22 2014
@@ -27,7 +27,7 @@
 from data_store import Relax_data_store; ds = Relax_data_store()
 from pipe_control import state
 from specific_analyses.relax_disp.checks import get_times
-from specific_analyses.relax_disp.disp_data import count_relax_times, 
get_curve_type, has_exponential_exp_type, loop_exp_frq, loop_exp_frq_offset, 
loop_exp_frq_offset_point, loop_exp_frq_offset_point_time, loop_time
+from specific_analyses.relax_disp.disp_data import count_relax_times, 
find_intensity_keys, get_curve_type, has_exponential_exp_type, loop_exp_frq, 
loop_exp_frq_offset, loop_exp_frq_offset_point, 
loop_exp_frq_offset_point_time, loop_time
 from status import Status; status = Status()
 from test_suite.unit_tests.base_classes import UnitTestCase
 
@@ -196,6 +196,34 @@
             self.assertEqual(count, time_comp['%s_%s'%(offset, point)])
 
 
+    def test_find_intensity_keys_r1rho(self):
+        """Unit test of the find_intensity_keys() function.
+
+        This uses the data of the saved state attached to U{bug 
#21344<https://gna.org/bugs/?21344>}.
+        """
+
+        # Load the state.
+        statefile = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'bug_21344_trunc.bz2'
+        state.load_state(statefile, force=True)
+
+        # Check the number of time counts.
+        print("Checking the id return experiment.")
+        for id in cdp.exp_type.keys():
+            exp_type = cdp.exp_type[id]
+            frq = cdp.spectrometer_frq[id]
+            offset = cdp.spin_lock_offset[id]
+            point = cdp.spin_lock_nu1[id]
+            time = cdp.relax_times[id]
+
+            ids = find_intensity_keys(exp_type=exp_type, frq=frq, 
offset=offset, point=point, time=time)
+
+            print(exp_type, frq, offset, point, time, id, ids)
+
+            # Test the id return
+            self.assertEqual(len(ids), 1)
+            self.assertEqual(ids[0], id)
+
+
     def test_get_curve_type_cpmg(self):
         """Unit test of the get_curve_type() function.
 




Related Messages


Powered by MHonArc, Updated Wed Feb 26 18:00:02 2014