Author: bugman Date: Mon Feb 4 18:17:35 2013 New Revision: 18405 URL: http://svn.gna.org/viewcvs/relax?rev=18405&view=rev Log: Merged revisions 18401-18404 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r18401 | bugman | 2013-02-04 17:55:53 +0100 (Mon, 04 Feb 2013) | 9 lines Created the State.test_bug_20480 system test to catch bug #20480 (https://gna.org/bugs/?20480). This bug was reported by Stanislava Panova (https://gna.org/users/stacy). The file test_suite/shared_data/saved_states/bug_20480.bz2 is the same as that attached to the bug report but with all residues except for 9 and 10 deleted. Currently the bug is not triggered! ........ r18402 | bugman | 2013-02-04 17:59:01 +0100 (Mon, 04 Feb 2013) | 7 lines Fix for the failed loading of states in the GUI. This problem was caught by the State.test_bug_20480 GUI test. If the loading of a state file fails, sometimes the relax data store can contain partial information from that file. Now if the loading fails in the GUI, relax is reset. ........ r18403 | bugman | 2013-02-04 17:59:30 +0100 (Mon, 04 Feb 2013) | 3 lines Removed a debugging line from the State.test_bug_20480 GUI test. ........ r18404 | bugman | 2013-02-04 18:10:32 +0100 (Mon, 04 Feb 2013) | 10 lines Fix for bug #20480 (https://gna.org/bugs/?20480). This was reported by Stanislava Panova (https://gna.org/users/stacy). The problem was that the state file was saved after a RelaxError occurred during the model-free analysis. The GUI data store information states that the active data pipe is called 'final'. But an error occurred prior to the 'final' data pipe being created. The fix was to allow the state to be loaded even if the GUI data store information has been corrupted. ........ Added: branches/frame_order_testing/test_suite/shared_data/saved_states/bug_20480.bz2 - copied unchanged from r18404, trunk/test_suite/shared_data/saved_states/bug_20480.bz2 Modified: branches/frame_order_testing/ (props changed) branches/frame_order_testing/gui/analyses/base.py branches/frame_order_testing/gui/relax_gui.py branches/frame_order_testing/test_suite/gui_tests/state.py Propchange: branches/frame_order_testing/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Mon Feb 4 18:17:35 2013 @@ -1,1 +1,1 @@ -/trunk:1-18399 +/trunk:1-18404 Modified: branches/frame_order_testing/gui/analyses/base.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/gui/analyses/base.py?rev=18405&r1=18404&r2=18405&view=diff ============================================================================== --- branches/frame_order_testing/gui/analyses/base.py (original) +++ branches/frame_order_testing/gui/analyses/base.py Mon Feb 4 18:17:35 2013 @@ -1,7 +1,7 @@ ############################################################################### # # # Copyright (C) 2009 Michael Bieri # -# Copyright (C) 2010-2012 Edward d'Auvergne # +# Copyright (C) 2010-2013 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -31,7 +31,7 @@ # relax module imports. from generic_fns.mol_res_spin import count_spins -from generic_fns.pipes import cdp_name +from generic_fns.pipes import cdp_name, has_pipe from user_functions.data import Uf_info; uf_info = Uf_info() from user_functions.data import Uf_tables; uf_tables = Uf_tables() @@ -448,7 +448,10 @@ pipe = cdp_name() # The count. - num = count_spins(pipe=pipe) + if not has_pipe(pipe): + num = 0 + else: + num = count_spins(pipe=pipe) # Return the formatted string. return "%s spins loaded and selected" % num Modified: branches/frame_order_testing/gui/relax_gui.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/gui/relax_gui.py?rev=18405&r1=18404&r2=18405&view=diff ============================================================================== --- branches/frame_order_testing/gui/relax_gui.py (original) +++ branches/frame_order_testing/gui/relax_gui.py Mon Feb 4 18:17:35 2013 @@ -846,6 +846,9 @@ # File loading failure. else: + # Reset relax to clear any partially loaded data. + reset() + # Reinitialise the GUI data store structure. self.init_data() Modified: branches/frame_order_testing/test_suite/gui_tests/state.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/test_suite/gui_tests/state.py?rev=18405&r1=18404&r2=18405&view=diff ============================================================================== --- branches/frame_order_testing/test_suite/gui_tests/state.py (original) +++ branches/frame_order_testing/test_suite/gui_tests/state.py Mon Feb 4 18:17:35 2013 @@ -37,6 +37,21 @@ class State(GuiTestCase): """Class for testing various aspects specific to saved states.""" + + def test_bug_20480(self): + """Catch bug #20480 (https://gna.org/bugs/?20480), the failure to load a relax state in the GUI.""" + + # Simulate the 'Open relax state' menu entry. + file = status.install_path + sep + 'test_suite' + sep + 'shared_data' + sep + 'saved_states' + sep + 'bug_20480.bz2' + self.app.gui.state_load(file_name=file) + + # Check that the data has been loaded. + self.assertEqual(cdp_name(), "aic - mf (Mon Feb 4 13:30:01 2013)") + self.assertEqual(cdp.frq['NOE_800'], 800000031.0) + self.assertEqual(cdp.frq['R1_800'], 800000031.0) + self.assertEqual(cdp.frq['R2_800'], 800000031.0) + self.assertEqual(cdp.frq['R2_600'], 599999000.0) + def test_old_state_loading(self): """Test the loading of an old relax 1.3 save state with GUI information."""