mailr13872 - in /branches/gui_testing/test_suite/gui_tests: __init__.py model_free.py


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

Header


Content

Posted by edward on July 26, 2011 - 09:31:
Author: bugman
Date: Tue Jul 26 09:31:41 2011
New Revision: 13872

URL: http://svn.gna.org/viewcvs/relax?rev=13872&view=rev
Log:
Started to construct the model-free auto-analysis GUI test.

The data checks are still rubbish (it is the NOE code), and the bond length 
and CSA values are still
not set.


Added:
    branches/gui_testing/test_suite/gui_tests/model_free.py
      - copied, changed from r13857, 
branches/gui_testing/test_suite/gui_tests/noe.py
Modified:
    branches/gui_testing/test_suite/gui_tests/__init__.py

Modified: branches/gui_testing/test_suite/gui_tests/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/__init__.py?rev=13872&r1=13871&r2=13872&view=diff
==============================================================================
--- branches/gui_testing/test_suite/gui_tests/__init__.py (original)
+++ branches/gui_testing/test_suite/gui_tests/__init__.py Tue Jul 26 09:31:41 
2011
@@ -32,13 +32,15 @@
 from test_suite.relax_test_runner import RelaxTestRunner
 
 # relax GUI test module imports.
+from model_free import Mf
 from noe import Noe
 from rx import Rx
 from state import State
 from test_suite.relax_test_loader import RelaxTestLoader as TestLoader
 
 
-__all__ = ['noe',
+__all__ = ['model_free',
+           'noe',
            'rx',
            'state']
 
@@ -79,6 +81,7 @@
 
         # All tests.
         if not tests:
+            suite_array.append(TestLoader().loadTestsFromTestCase(Mf))
             suite_array.append(TestLoader().loadTestsFromTestCase(Noe))
             suite_array.append(TestLoader().loadTestsFromTestCase(Rx))
             suite_array.append(TestLoader().loadTestsFromTestCase(State))

Copied: branches/gui_testing/test_suite/gui_tests/model_free.py (from r13857, 
branches/gui_testing/test_suite/gui_tests/noe.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/gui_testing/test_suite/gui_tests/model_free.py?p2=branches/gui_testing/test_suite/gui_tests/model_free.py&p1=branches/gui_testing/test_suite/gui_tests/noe.py&r1=13857&r2=13872&rev=13872&view=diff
==============================================================================
--- branches/gui_testing/test_suite/gui_tests/noe.py (original)
+++ branches/gui_testing/test_suite/gui_tests/model_free.py Tue Jul 26 
09:31:41 2011
@@ -32,21 +32,22 @@
 from test_suite.gui_tests.base_classes import GuiTestCase
 
 # relax GUI imports.
-from gui.misc import int_to_gui, str_to_gui
-from gui.user_functions import deselect, sequence, spin
+from gui.misc import float_to_gui, str_to_gui
+from gui.user_functions import relax_data, sequence
 from gui.wizard import Wiz_window
 
 
-class Noe(GuiTestCase):
-    """Class for testing various aspects specific to the NOE analysis."""
+class Mf(GuiTestCase):
+    """Class for testing various aspects specific to the model-free 
auto-analysis."""
 
-    def test_noe_analysis(self):
-        """Test the NOE analysis."""
+    def test_mf_auto_analysis(self):
+        """Test the model-free auto-analysis."""
 
         # Simulate the new analysis wizard.
         self.gui.analysis.menu_new(None)
         page = self.gui.analysis.new_wizard.wizard.get_page(0)
-        page.select_noe(None)
+        page.select_mf(None)
+        page.analysis_name.SetValue("Model-free test")
         self.gui.analysis.new_wizard.wizard._go_next(None)
         page = self.gui.analysis.new_wizard.wizard.get_page(1)
         self.gui.analysis.new_wizard.wizard._go_next(None)
@@ -58,73 +59,68 @@
         self.gui.analysis.new_analysis(analysis_type=analysis_type, 
analysis_name=analysis_name, pipe_name=pipe_name)
 
         # Alias the analysis.
-        analysis = self.gui.analysis.get_page_from_name("Steady-state NOE")
-
-        # The frequency label.
-        analysis.field_nmr_frq.SetValue(str_to_gui('500'))
+        analysis = self.gui.analysis.get_page_from_name("Model-free test")
 
         # Change the results directory.
         analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir))
 
+        # Set up a wizard window instance for all of the user function pages.
+        wizard = Wiz_window()
+
+        # The data path.
+        data_path = status.install_path + sep + 'test_suite' + sep + 
'shared_data' + sep + 'model_free' + sep + 'sphere' + sep
+
         # Load the sequence.
-        wizard = Wiz_window()
         seq_read = sequence.Read_page(wizard, self.gui)
-        file = status.install_path + sep + 'test_suite' + sep + 
'shared_data' + sep + 'Ap4Aase.seq'
-        seq_read.file.SetValue(str_to_gui(file))
-        seq_read.mol_name_col.SetValue(int_to_gui(None))
-        seq_read.res_name_col.SetValue(int_to_gui(2))
-        seq_read.res_num_col.SetValue(int_to_gui(1))
-        seq_read.spin_name_col.SetValue(int_to_gui(None))
-        seq_read.spin_num_col.SetValue(int_to_gui(None))
+        seq_read.file.SetValue(str_to_gui(data_path + 'noe.500.out'))
         seq_read.on_execute()
 
-        # Unresolved spins.
-        deselect_spin = deselect.Spin_page(wizard, self.gui)
-        deselect_spin.spin_id.SetValue(str_to_gui(":3"))
-        deselect_spin.on_execute()
+        # Load the relaxation data.
+        data = [
+            ['noe.500.out', 'noe_500', 'NOE', 500e6],
+            ['r1.500.out',  'r1_500',  'R1',  500e6],
+            ['r2.500.out',  'r2_500',  'R2',  500e6],
+            ['noe.900.out', 'noe_900', 'NOE', 900e6],
+            ['r1.900.out',  'r1_900',  'R1',  900e6],
+            ['r2.900.out',  'r2_900',  'R2',  900e6]
+        ]
+        for i in range(len(data)):
+            relax_data_read = relax_data.Read_page(wizard, self.gui)
+            relax_data_read.file.SetValue(str_to_gui(data_path + data[i][0]))
+            relax_data_read.ri_id.SetValue(str_to_gui(data[i][1]))
+            relax_data_read.ri_type.SetValue(str_to_gui(data[i][2]))
+            relax_data_read.frq.SetValue(float_to_gui(data[i][3]))
+            relax_data_read.on_execute()
 
-        # Name the spins.
-        page = spin.Name_page(wizard, self.gui)
-        page.name.SetValue(str_to_gui('N'))
-        page.on_execute()
+        # Select only the tm0 and tm1 local tm models.
+        for i in 
range(analysis.local_tm_model_field.model_win.model_list.GetItemCount()):
+            if i in [0, 1]:
+                
analysis.local_tm_model_field.model_win.model_list.CheckItem(i, check=True)
+            else:
+                
analysis.local_tm_model_field.model_win.model_list.CheckItem(i, check=False)
+        analysis.local_tm_model_field.modify(None)
 
-        # The intensity data.
-        ids = ['ref', 'sat']
-        files = [
-            status.install_path + sep + 'test_suite' + sep + 'shared_data' + 
sep + 'peak_lists' + sep + 'ref_ave.list',
-            status.install_path + sep + 'test_suite' + sep + 'shared_data' + 
sep + 'peak_lists' + sep + 'sat_ave.list'
-        ]
-        errors = [3600, 3000]
-        types = [1, 0]
+        # Select only the m1 and m2 model-free models.
+        for i in 
range(analysis.mf_model_field.model_win.model_list.GetItemCount()):
+            if i in [1, 2]:
+                analysis.mf_model_field.model_win.model_list.CheckItem(i, 
check=True)
+            else:
+                analysis.mf_model_field.model_win.model_list.CheckItem(i, 
check=False)
+        analysis.mf_model_field.modify(None)
 
-        # Loop over the 2 spectra.
-        for i in range(2):
-            # Set up the peak intensity wizard.
-            analysis.peak_wizard(None)
+        # Change the grid increments.
+        analysis.grid_inc.SetValue(3)
 
-            # The spectrum.
-            page = analysis.wizard.get_page(analysis.page_indices['read'])
-            page.file.SetValue(str_to_gui(files[i]))
-            page.spectrum_id.SetValue(str_to_gui(ids[i]))
-            page.proton.SetValue(str_to_gui('HN'))
+        # Set the number of Monte Carlo simulations.
+        analysis.mc_sim_num.SetValue(2)
 
-            # Move down 2 pages.
-            analysis.wizard._go_next(None)
-            analysis.wizard._go_next(None)
-
-            # Set the errors.
-            page = analysis.wizard.get_page(analysis.page_indices['rmsd'])
-            page.error.SetValue(int_to_gui(errors[i]))
-
-            # Go to the next page.
-            analysis.wizard._go_next(None)
-
-            # Set the type.
-            page = 
analysis.wizard.get_page(analysis.page_indices['spectrum_type'])
-            page.spectrum_type.SetSelection(types[i])
-
-            # Go to the next page (i.e. finish).
-            analysis.wizard._go_next(None)
+        # Check that the data has been correctly updated prior to execution.
+        analysis.sync_ds(upload=True)
+        self.assertEqual(analysis.data.save_dir, ds.tmpdir)
+        self.assertEqual(analysis.data.local_tm_models, ['tm0', 'tm1'])
+        self.assertEqual(analysis.data.mf_models, ['m1', 'm2'])
+        self.assertEqual(analysis.data.grid_inc, 3)
+        self.assertEqual(analysis.data.mc_sim_num, 2)
 
         # Execute relax.
         analysis.execute(wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, 
analysis.button_exec_id))




Related Messages


Powered by MHonArc, Updated Tue Jul 26 10:00:02 2011