Author: bugman Date: Mon Feb 10 10:48:44 2014 New Revision: 22168 URL: http://svn.gna.org/viewcvs/relax?rev=22168&view=rev Log: Merged revisions 22165-22166 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r22165 | bugman | 2014-02-10 10:37:53 +0100 (Mon, 10 Feb 2014) | 9 lines Created the Mf.test_bug_21615_incomplete_setup_failure GUI tests. This is designed to catch bug #21615 (https://gna.org/bugs/?21615) as reported by Ivan Leung (ivanhoe dott leung att chem dott ox dot ac dot uk). Included are the data files Ivan attached to the bug report truncated to two residues. The GUI test follows exactly the steps outlined by Ivan. ........ r22166 | bugman | 2014-02-10 10:43:46 +0100 (Mon, 10 Feb 2014) | 10 lines Fix for bug #21615, the missing data dialog failure when executing the GUI model-free analysis. This is the bug at https://gna.org/bugs/?21615 as reported by Ivan Leung (ivanhoe dott leung att chem dott ox dot ac dot uk). The problem is that the spin container's "isotope" variable is being accessed directly after a test showing that this variable does not exist. This is now fixed so that the missing data dialog is now presented explaining that the spin isotope information is not set. ........ Added: branches/double_rotor/test_suite/shared_data/model_free/bug_21615_incomplete_setup_failure/ - copied from r22166, trunk/test_suite/shared_data/model_free/bug_21615_incomplete_setup_failure/ Modified: branches/double_rotor/ (props changed) branches/double_rotor/gui/analyses/auto_model_free.py branches/double_rotor/test_suite/gui_tests/model_free.py Propchange: branches/double_rotor/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Mon Feb 10 10:48:44 2014 @@ -1,1 +1,1 @@ -/trunk:1-22153,22155-22164 +/trunk:1-22167 Modified: branches/double_rotor/gui/analyses/auto_model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/gui/analyses/auto_model_free.py?rev=22168&r1=22167&r2=22168&view=diff ============================================================================== --- branches/double_rotor/gui/analyses/auto_model_free.py (original) +++ branches/double_rotor/gui/analyses/auto_model_free.py Mon Feb 10 10:48:44 2014 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010-2013 Edward d'Auvergne # +# Copyright (C) 2010-2014 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -413,7 +413,7 @@ missing.append(msg % ("nuclear isotope data", "spin.isotope")) # Test if the CSA value has been set for the heteronuclei. - if spin.isotope in ['15N', '13C'] and (not hasattr(spin, 'csa') or spin.csa == None): + if (hasattr(spin, 'isotope') and spin.isotope in ['15N', '13C']) and (not hasattr(spin, 'csa') or spin.csa == None): missing.append(msg % ("CSA data", "value.set")) # Interatomic data container variables. Modified: branches/double_rotor/test_suite/gui_tests/model_free.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/gui_tests/model_free.py?rev=22168&r1=22167&r2=22168&view=diff ============================================================================== --- branches/double_rotor/test_suite/gui_tests/model_free.py (original) +++ branches/double_rotor/test_suite/gui_tests/model_free.py Mon Feb 10 10:48:44 2014 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2006-2013 Edward d'Auvergne # +# Copyright (C) 2006-2014 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -185,6 +185,91 @@ # Exceptions in the thread. self.check_exceptions() + + + def test_bug_21615_incomplete_setup_failure(self): + """Catch U{bug #21615<https://gna.org/bugs/?21615>}, the failure of showing the missing data dialog when executing the analysis with an incomplete setup. + + This was reported by Ivan Leung. + """ + + # Simulate the new analysis wizard. + self.app.gui.analysis.menu_new(None) + page = self.app.gui.analysis.new_wizard.wizard.get_page(0) + page.select_mf(None) + page.analysis_name.SetValue(str_to_gui("Model-free incomplete setup failure")) + self.app.gui.analysis.new_wizard.wizard._go_next(None) + page = self.app.gui.analysis.new_wizard.wizard.get_page(1) + self.app.gui.analysis.new_wizard.wizard._go_next(None) + + # Get the data. + analysis_type, analysis_name, pipe_name, pipe_bundle, uf_exec = self.app.gui.analysis.new_wizard.get_data() + + # Set up the analysis. + self.app.gui.analysis.new_analysis(analysis_type=analysis_type, analysis_name=analysis_name, pipe_name=pipe_name, pipe_bundle=pipe_bundle) + + # Alias the analysis. + analysis = self.app.gui.analysis.get_page_from_name("Model-free incomplete setup failure") + + # Change the results directory. + analysis.field_results_dir.SetValue(str_to_gui(ds.tmpdir)) + + # The data path. + data_path = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'model_free' + sep + 'bug_21615_incomplete_setup_failure' + sep + + # Launch the spin viewer window. + self.app.gui.show_tree() + + # Spin loading wizard: Initialisation. + self.app.gui.spin_viewer.load_spins_wizard() + + # Spin loading wizard: The PDB file. + page = self.app.gui.spin_viewer.wizard.get_page(0) + page.selection = 'new pdb' + self.app.gui.spin_viewer.wizard._go_next() + page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) + page.uf_args['file'].SetValue(str_to_gui(data_path + 'Truncated_ForBugReport.pdb')) + self.app.gui.spin_viewer.wizard._go_next() + interpreter.flush() # Required because of the asynchronous uf call. + + # Spin loading wizard: The spin loading. + page = self.app.gui.spin_viewer.wizard.get_page(self.app.gui.spin_viewer.wizard._current_page) + page.uf_args['spin_id'].SetValue(str_to_gui('@N')) + self.app.gui.spin_viewer.wizard._apply() + page.uf_args['spin_id'].SetValue(str_to_gui('@H')) + self.app.gui.spin_viewer.wizard._go_next() + interpreter.flush() # Required because of the asynchronous uf call. + + # Close the spin viewer window. + self.app.gui.spin_viewer.handler_close() + + # Flush the interpreter in preparation for the synchronous user functions of the peak list wizard. + interpreter.flush() + + # Set the element type. + self._execute_uf(uf_name='spin.element', element='N') + + # Load the relaxation data. + data = [ + ['NOE_ForBugReport.txt', 'noe_800', 'NOE', 800000001.0], + ['T1_ForBugReport.txt', 'r1_800', 'R1', 800000001.0], + ['T2_ForBugReport.txt', 'r2_800', 'R2', 800000001.0] + ] + for i in range(len(data)): + self._execute_uf(uf_name='relax_data.read', file=data_path+data[i][0], ri_id=data[i][1], ri_type=data[i][2], frq=data[i][3], mol_name_col=1, res_num_col=2, res_name_col=3, spin_num_col=4, spin_name_col=5, data_col=6, error_col=7) + + # Execute relax. + state = analysis.execute(wx.CommandEvent(wx.wxEVT_COMMAND_BUTTON_CLICKED, analysis.button_exec_relax.GetId())) + + # Wait for execution to complete. + if hasattr(analysis, 'thread'): + analysis.thread.join() + + # Flush all wx events. + wx.Yield() + + # Exceptions in the thread. + self.check_exceptions() def test_mf_auto_analysis(self):