Author: bugman Date: Wed Mar 4 15:33:57 2015 New Revision: 27781 URL: http://svn.gna.org/viewcvs/relax?rev=27781&view=rev Log: Merged revisions 27776-27780 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r27776 | bugman | 2015-03-04 15:10:39 +0100 (Wed, 04 Mar 2015) | 5 lines Fixes for the align_tensor.copy user function argument unit tests. The tensor_from and tensor_to arguments can now be None. ........ r27777 | bugman | 2015-03-04 15:23:13 +0100 (Wed, 04 Mar 2015) | 6 lines Created the Align_tensor.test_copy_pipes_sims system test. This demonstrates a failure of the align_tensor.copy user function when Monte Carlo simulated tensors are present. ........ r27778 | bugman | 2015-03-04 15:28:53 +0100 (Wed, 04 Mar 2015) | 3 lines Copyright update. ........ r27779 | bugman | 2015-03-04 15:32:53 +0100 (Wed, 04 Mar 2015) | 6 lines Deleted the data_store.align_tensor.AlignTensorSimList.append() method. This replacement list method was proving fatal when copy.deepcopy() is called on the alignment tensor object. The change allows the Align_tensor.test_copy_pipes_sims system test to pass. ........ r27780 | bugman | 2015-03-04 15:33:20 +0100 (Wed, 04 Mar 2015) | 3 lines Copyright update. ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/data_store/align_tensor.py branches/frame_order_cleanup/pipe_control/align_tensor.py branches/frame_order_cleanup/test_suite/system_tests/align_tensor.py branches/frame_order_cleanup/test_suite/unit_tests/_prompt/test_align_tensor.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Wed Mar 4 15:33:57 2015 @@ -1 +1 @@ -/trunk:1-27774 +/trunk:1-27780 Modified: branches/frame_order_cleanup/data_store/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/data_store/align_tensor.py?rev=27781&r1=27780&r2=27781&view=diff ============================================================================== --- branches/frame_order_cleanup/data_store/align_tensor.py (original) +++ branches/frame_order_cleanup/data_store/align_tensor.py Wed Mar 4 15:33:57 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2014 Edward d'Auvergne # +# Copyright (C) 2003-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -1497,9 +1497,3 @@ # Execute the base class method. super(AlignTensorSimList, self).__setitem__(sim_index, value) - - - def append(self, value): - """This is a read-only object!""" - - raise RelaxError("The alignment tensor is a read-only object. The alignment tensor set() method must be used instead.") Modified: branches/frame_order_cleanup/pipe_control/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/align_tensor.py?rev=27781&r1=27780&r2=27781&view=diff ============================================================================== --- branches/frame_order_cleanup/pipe_control/align_tensor.py (original) +++ branches/frame_order_cleanup/pipe_control/align_tensor.py Wed Mar 4 15:33:57 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003-2014 Edward d'Auvergne # +# Copyright (C) 2003-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # Modified: branches/frame_order_cleanup/test_suite/system_tests/align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/system_tests/align_tensor.py?rev=27781&r1=27780&r2=27781&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/system_tests/align_tensor.py (original) +++ branches/frame_order_cleanup/test_suite/system_tests/align_tensor.py Wed Mar 4 15:33:57 2015 @@ -20,6 +20,7 @@ ############################################################################### # Python module imports. +from copy import deepcopy from tempfile import mktemp # relax module imports. @@ -310,6 +311,37 @@ self.assertEqual(cdp.align_tensors[0].name, 'orig') + def test_copy_pipes_sims(self): + """Test the copying of alignment tensor Monte Carlo simulations between data pipes.""" + + # First reset. + self.interpreter.reset() + + # Create two data pipes. + self.interpreter.pipe.create('target', 'N-state') + self.interpreter.pipe.create('source', 'N-state') + + # Initialise one tensor. + self.interpreter.align_tensor.init(tensor='orig', align_id='test', params=self.tensors_full[0], param_types=0) + + # Set up the number of simulations. + sim_number = 10 + cdp.align_tensors[0].set_sim_num(sim_number) + + # Initialise simulation tensors. + for object_name in ['Axx', 'Ayy', 'Axy', 'Axz', 'Ayz']: + for i in range(sim_number): + cdp.align_tensors[0].set(param=object_name, value=deepcopy(getattr(cdp.align_tensors[0], object_name)), category='sim', sim_index=i) + + # Copy the tensor. + self.interpreter.align_tensor.copy(pipe_from='source', pipe_to='target') + + # Checks. + self.interpreter.pipe.switch('target') + self.assertEqual(len(cdp.align_tensors), 1) + self.assertEqual(cdp.align_tensors[0].name, 'orig') + + def test_fix(self): """Test the align_tensor.fix user function.""" Modified: branches/frame_order_cleanup/test_suite/unit_tests/_prompt/test_align_tensor.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/test_suite/unit_tests/_prompt/test_align_tensor.py?rev=27781&r1=27780&r2=27781&view=diff ============================================================================== --- branches/frame_order_cleanup/test_suite/unit_tests/_prompt/test_align_tensor.py (original) +++ branches/frame_order_cleanup/test_suite/unit_tests/_prompt/test_align_tensor.py Wed Mar 4 15:33:57 2015 @@ -53,11 +53,11 @@ # Loop over the data types. for data in DATA_TYPES: # Catch the str argument, and skip it. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.align_tensor_fns.copy, tensor_from=data[1]) + if data[0] == 'None' or data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxNoneStrError, self.align_tensor_fns.copy, tensor_from=data[1]) def test_copy_argfail_pipe_from(self): @@ -79,11 +79,11 @@ # Loop over the data types. for data in DATA_TYPES: # Catch the str argument, and skip it. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.align_tensor_fns.copy, tensor_to=data[1]) + if data[0] == 'None' or data[0] == 'str': + continue + + # The argument test. + self.assertRaises(RelaxNoneStrError, self.align_tensor_fns.copy, tensor_to=data[1]) def test_copy_argfail_pipe_to(self):