mailr12758 - /branches/relax_data/test_suite/system_tests/dasha.py


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

Header


Content

Posted by edward on March 03, 2011 - 11:07:
Author: bugman
Date: Thu Mar  3 11:07:27 2011
New Revision: 12758

URL: http://svn.gna.org/viewcvs/relax?rev=12758&view=rev
Log:
The Dasha system test is now thoroughly checking all of the relax data store.


Modified:
    branches/relax_data/test_suite/system_tests/dasha.py

Modified: branches/relax_data/test_suite/system_tests/dasha.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_data/test_suite/system_tests/dasha.py?rev=12758&r1=12757&r2=12758&view=diff
==============================================================================
--- branches/relax_data/test_suite/system_tests/dasha.py (original)
+++ branches/relax_data/test_suite/system_tests/dasha.py Thu Mar  3 11:07:27 
2011
@@ -1,7 +1,7 @@
 
###############################################################################
 #                                                                            
 #
 # Copyright (C) 2008 Sebastien Morin                                         
 #
-# Copyright (C) 2010 Edward d'Auvergne                                       
 #
+# Copyright (C) 2010-2011 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -30,6 +30,7 @@
 # relax module imports.
 from base_classes import SystemTestCase
 from data import Relax_data_store; ds = Relax_data_store()
+from generic_fns.mol_res_spin import spin_loop
 from relax_io import test_binary
 from status import Status; status = Status()
 
@@ -72,3 +73,73 @@
 
         # Execute the script.
         self.interpreter.run(script_file=status.install_path + 
sep+'test_suite'+sep+'system_tests'+sep+'scripts'+sep+'dasha.py')
+
+        # Check the global data.
+        self.assertEqual(cdp.chi2, 0.63673000000000002)
+        self.assertEqual(len(cdp.ri_ids), 3)
+        for ri_id in cdp.ri_ids:
+            self.assertEqual(cdp.frq[ri_id], 600000000.0)
+        self.assertEqual(cdp.ri_type['R1_600'], 'R1')
+        self.assertEqual(cdp.ri_type['R2_600'], 'R2')
+        self.assertEqual(cdp.ri_type['NOE_600'], 'NOE')
+
+        # The spin data.
+        select = [True, True, False]
+        fixed = [None, None, None]
+        proton_type = [None, None, None]
+        heteronuc_type = ['15N', '15N', '15N']
+        attached_proton = [None, None, None]
+        nucleus = [None, None, None]
+        model = ['m3', 'm3', 'm3']
+        equation = ['mf_orig', 'mf_orig', 'mf_orig']
+        params = [['S2', 'Rex'], ['S2', 'Rex'], ['S2', 'Rex']]
+        xh_vect = [None, None, None]
+        s2 = [0.64359, 0.64359, 0.64359]
+        s2f = [None, None, 0.8]
+        s2s = [None, None, 0.8]
+        local_tm = [None, None, None]
+        te = [None, None, 0.01]
+        tf = [None, None, 0.001]
+        ts = [None, None, 0.1]
+        rex = [4.29432, 4.29432, 4.29432]
+        r = [1.02e-10, 1.02e-10, 1.02e-10]
+        csa = [-172e-6, -172e-6, -172e-6]
+        chi2 = [None, None, None]
+        ri_data = [{'R1_600': 1.0, 'R2_600': 15.0, 'NOE_600': 0.9},
+                   {'R1_600': 0.9, 'R2_600': 13.9, 'NOE_600': 0.79},
+                   {'R2_600': 12.0, 'NOE_600': 0.6}]
+        ri_data_err = [{'R1_600': 0.05, 'R2_600': 0.5, 'NOE_600': 0.05},
+                       {'R1_600': 0.05, 'R2_600': 0.8, 'NOE_600': 0.05},
+                       {'R2_600': 0.5, 'NOE_600': 0.05}]
+
+        # Check the spin data.
+        i = 0
+        for spin in spin_loop():
+            # Check the data.
+            self.assertEqual(spin.select, select[i])
+            self.assertEqual(spin.fixed, fixed[i])
+            self.assertEqual(spin.proton_type, proton_type[i])
+            self.assertEqual(spin.heteronuc_type, heteronuc_type[i])
+            self.assertEqual(spin.attached_proton, attached_proton[i])
+            self.assertEqual(spin.nucleus, nucleus[i])
+            self.assertEqual(spin.model, model[i])
+            self.assertEqual(spin.equation, equation[i])
+            self.assertEqual(spin.params, params[i])
+            self.assertEqual(spin.xh_vect, xh_vect[i])
+            self.assertEqual(spin.s2, s2[i])
+            self.assertEqual(spin.s2f, s2f[i])
+            self.assertEqual(spin.s2s, s2s[i])
+            self.assertEqual(spin.local_tm, local_tm[i])
+            self.assertEqual(spin.te, te[i])
+            self.assertEqual(spin.tf, tf[i])
+            self.assertEqual(spin.ts, ts[i])
+            self.assertEqual(spin.rex, rex[i])
+            self.assertAlmostEqual(spin.r, r[i])
+            self.assertAlmostEqual(spin.csa, csa[i])
+            self.assertEqual(spin.chi2, chi2[i])
+            for ri_id in cdp.ri_ids:
+                if ri_id in ri_data[i].keys():
+                    self.assertEqual(spin.ri_data[ri_id], ri_data[i][ri_id])
+
+            # Increment the spin index.
+            i += 1




Related Messages


Powered by MHonArc, Updated Thu Mar 03 11:20:01 2011