mailr22348 - in /trunk: specific_analyses/relax_disp/api.py 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:56:
Author: tlinnet
Date: Wed Feb 26 17:56:16 2014
New Revision: 22348

URL: http://svn.gna.org/viewcvs/relax?rev=22348&view=rev
Log:
Modified unit test for find_intensity_keys() to simulate method in 
sim_pack_data().

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/specific_analyses/relax_disp/api.py
    
trunk/test_suite/unit_tests/_specific_analyses/_relax_disp/test_disp_data.py

Modified: trunk/specific_analyses/relax_disp/api.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/api.py?rev=22348&r1=22347&r2=22348&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/api.py (original)
+++ trunk/specific_analyses/relax_disp/api.py Wed Feb 26 17:56:16 2014
@@ -1602,6 +1602,9 @@
                 # Get the intensity keys.
                 int_keys = find_intensity_keys(exp_type=exp_type, frq=frq, 
point=point, time=time)
 
+                if len(int_keys) > 1:
+                    raise RelaxError("Error %s" % int_keys)
+
                 # Loop over the intensity keys.
                 for int_key in int_keys:
                     # Test if the simulation data point already exists.

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=22348&r1=22347&r2=22348&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:56:16 2014
@@ -206,6 +206,78 @@
         statefile = status.install_path + 
sep+'test_suite'+sep+'shared_data'+sep+'dispersion'+sep+'bug_21344_trunc.bz2'
         state.load_state(statefile, force=True)
 
+        # Original data (spectrum id: exp_type, frq, omega_rf_ppm, 
spin_lock_field_strength, time_spin_lock).
+        data = {
+        '46_0_35_0':['R1rho', 799777399.1, 118.078, 431.0, 0.0],
+        '48_0_35_4':['R1rho', 799777399.1, 118.078, 431.0, 0.04],
+        '47_0_35_10':['R1rho', 799777399.1, 118.078, 431.0, 0.1],
+        '49_0_35_20':['R1rho', 799777399.1, 118.078, 431.0, 0.2],
+        '36_0_39_0':['R1rho', 799777399.1, 118.078, 651.2, 0.0],
+        '39_0_39_4':['R1rho', 799777399.1, 118.078, 651.2, 0.04],
+        '37_0_39_10':['R1rho', 799777399.1, 118.078, 651.2, 0.1],
+        '40_0_39_20':['R1rho', 799777399.1, 118.078, 651.2, 0.2],
+        '38_0_39_40':['R1rho', 799777399.1, 118.078, 651.2, 0.4],
+        '41_0_41_0':['R1rho', 799777399.1, 118.078, 800.5, 0.0],
+        '44_0_41_4':['R1rho', 799777399.1, 118.078, 800.5, 0.04],
+        '42_0_41_10':['R1rho', 799777399.1, 118.078, 800.5, 0.1],
+        '45_0_41_20':['R1rho', 799777399.1, 118.078, 800.5, 0.2],
+        '43_0_41_40':['R1rho', 799777399.1, 118.078, 800.5, 0.4],
+        '31_0_43_0':['R1rho', 799777399.1, 118.078, 984.0, 0.0],
+        '34_0_43_4':['R1rho', 799777399.1, 118.078, 984.0, 0.04],
+        '32_0_43_10':['R1rho', 799777399.1, 118.078, 984.0, 0.1],
+        '35_0_43_20':['R1rho', 799777399.1, 118.078, 984.0, 0.2],
+        '33_0_43_40':['R1rho', 799777399.1, 118.078, 984.0, 0.4],
+        '1_0_46_0':['R1rho', 799777399.1, 118.078, 1341.11, 0.0],
+        '4_0_46_4':['R1rho', 799777399.1, 118.078, 1341.11, 0.04],
+        '2_0_46_10':['R1rho', 799777399.1, 118.078, 1341.11, 0.1],
+        '5_0_46_20':['R1rho', 799777399.1, 118.078, 1341.11, 0.2],
+        '3_0_46_40':['R1rho', 799777399.1, 118.078, 1341.11, 0.4],
+        '60_0_48_0':['R1rho', 799777399.1, 118.078, 1648.5, 0.0],
+        '63_0_48_4':['R1rho', 799777399.1, 118.078, 1648.5, 0.04],
+        '61_0_48_10':['R1rho', 799777399.1, 118.078, 1648.5, 0.1],
+        '62_0_48_14':['R1rho', 799777399.1, 118.078, 1648.5, 0.14],
+        '64_0_48_20':['R1rho', 799777399.1, 118.078, 1648.5, 0.2],
+        '11_500_46_0':['R1rho', 799777399.1, 124.24703146206046, 1341.11, 
0.0],
+        '14_500_46_4':['R1rho', 799777399.1, 124.24703146206046, 1341.11, 
0.04],
+        '12_500_46_10':['R1rho', 799777399.1, 124.24703146206046, 1341.11, 
0.1],
+        '15_500_46_20':['R1rho', 799777399.1, 124.24703146206046, 1341.11, 
0.2],
+        '13_500_46_40':['R1rho', 799777399.1, 124.24703146206046, 1341.11, 
0.4],
+        '50_1000_41_0':['R1rho', 799777399.1, 130.41606292412092, 800.5, 
0.0],
+        '53_1000_41_4':['R1rho', 799777399.1, 130.41606292412092, 800.5, 
0.04],
+        '51_1000_41_10':['R1rho', 799777399.1, 130.41606292412092, 800.5, 
0.1],
+        '54_1000_41_20':['R1rho', 799777399.1, 130.41606292412092, 800.5, 
0.2],
+        '52_1000_41_40':['R1rho', 799777399.1, 130.41606292412092, 800.5, 
0.4],
+        '21_1000_46_0':['R1rho', 799777399.1, 130.41606292412092, 1341.11, 
0.0],
+        '24_1000_46_4':['R1rho', 799777399.1, 130.41606292412092, 1341.11, 
0.04],
+        '22_1000_46_10':['R1rho', 799777399.1, 130.41606292412092, 1341.11, 
0.1],
+        '25_1000_46_20':['R1rho', 799777399.1, 130.41606292412092, 1341.11, 
0.2],
+        '23_1000_46_40':['R1rho', 799777399.1, 130.41606292412092, 1341.11, 
0.4],
+        '65_1000_48_0':['R1rho', 799777399.1, 130.41606292412092, 1648.5, 
0.0],
+        '68_1000_48_4':['R1rho', 799777399.1, 130.41606292412092, 1648.5, 
0.04],
+        '66_1000_48_10':['R1rho', 799777399.1, 130.41606292412092, 1648.5, 
0.1],
+        '67_1000_48_14':['R1rho', 799777399.1, 130.41606292412092, 1648.5, 
0.14],
+        '69_1000_48_20':['R1rho', 799777399.1, 130.41606292412092, 1648.5, 
0.2],
+        '55_2000_41_0':['R1rho', 799777399.1, 142.75412584824184, 800.5, 
0.0],
+        '58_2000_41_4':['R1rho', 799777399.1, 142.75412584824184, 800.5, 
0.04],
+        '56_2000_41_10':['R1rho', 799777399.1, 142.75412584824184, 800.5, 
0.1],
+        '59_2000_41_20':['R1rho', 799777399.1, 142.75412584824184, 800.5, 
0.2],
+        '57_2000_41_40':['R1rho', 799777399.1, 142.75412584824184, 800.5, 
0.4],
+        '6_2000_46_0':['R1rho', 799777399.1, 142.75412584824184, 1341.11, 
0.0],
+        '9_2000_46_4':['R1rho', 799777399.1, 142.75412584824184, 1341.11, 
0.04],
+        '7_2000_46_10':['R1rho', 799777399.1, 142.75412584824184, 1341.11, 
0.1],
+        '10_2000_46_20':['R1rho', 799777399.1, 142.75412584824184, 1341.11, 
0.2],
+        '8_2000_46_40':['R1rho', 799777399.1, 142.75412584824184, 1341.11, 
0.4],
+        '16_5000_46_0':['R1rho', 799777399.1, 179.76831462060457, 1341.11, 
0.0],
+        '19_5000_46_4':['R1rho', 799777399.1, 179.76831462060457, 1341.11, 
0.04],
+        '17_5000_46_10':['R1rho', 799777399.1, 179.76831462060457, 1341.11, 
0.1],
+        '20_5000_46_20':['R1rho', 799777399.1, 179.76831462060457, 1341.11, 
0.2],
+        '18_5000_46_40':['R1rho', 799777399.1, 179.76831462060457, 1341.11, 
0.4],
+        '26_10000_46_0':['R1rho', 799777399.1, 241.45862924120914, 1341.11, 
0.0],
+        '29_10000_46_4':['R1rho', 799777399.1, 241.45862924120914, 1341.11, 
0.04],
+        '27_10000_46_10':['R1rho', 799777399.1, 241.45862924120914, 1341.11, 
0.1],
+        '30_10000_46_20':['R1rho', 799777399.1, 241.45862924120914, 1341.11, 
0.2],
+        '28_10000_46_40':['R1rho', 799777399.1, 241.45862924120914, 1341.11, 
0.4]}
+
         # Check the number of time counts.
         print("Checking the id return experiment.")
         for id in cdp.exp_type.keys():
@@ -213,15 +285,16 @@
             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)
+
+            # Loop over time
+            for time in loop_time(exp_type=exp_type, frq=frq, offset=offset, 
point=point):
+                ids = find_intensity_keys(exp_type=exp_type, frq=frq, 
offset=offset, point=point, time=time)
+
+                print(exp_type, frq, offset, point, time, data[id][4], id, 
ids)
+
+                # Test the id return
+                self.assertEqual(len(ids), 1)
+                self.assertEqual(ids[0], id)
 
 
     def test_get_curve_type_cpmg(self):




Related Messages


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