Author: bugman Date: Wed May 9 09:45:24 2012 New Revision: 16130 URL: http://svn.gna.org/viewcvs/relax?rev=16130&view=rev Log: Improved error reporting for multiple vectors in a model-free analysis. This was reported by Vitaly Vostrikov (vvostri att uark.edu) at http://www.mail-archive.com/relax-users@xxxxxxx/msg00991.html (Message-ID: <CAO2iSXE1ycB4KX1vxqk15CxbW1rpWczZAyR_bX1g6j+yA2PCTQ@xxxxxxxxxxxxxx>) and reported at bug #18807 (https://gna.org/bugs/?18807). Modified: 1.3/relax_errors.py 1.3/specific_fns/model_free/mf_minimise.py Modified: 1.3/relax_errors.py URL: http://svn.gna.org/viewcvs/relax/1.3/relax_errors.py?rev=16130&r1=16129&r2=16130&view=diff ============================================================================== --- 1.3/relax_errors.py (original) +++ 1.3/relax_errors.py Wed May 9 09:45:24 2012 @@ -258,6 +258,11 @@ def __init__(self, name): self.text = "The PDB file " + repr(name) + " could not be loaded properly, no molecular chains could be extracted." +# Multiple unit vectors. +class RelaxMultiVectorError(BaseError): + def __init__(self): + self.text = "The multiple unit XH bond vectors per spin - this is not supported by the current data pipe type." + # No unit vectors. class RelaxNoVectorsError(BaseError): def __init__(self, pipe): Modified: 1.3/specific_fns/model_free/mf_minimise.py URL: http://svn.gna.org/viewcvs/relax/1.3/specific_fns/model_free/mf_minimise.py?rev=16130&r1=16129&r2=16130&view=diff ============================================================================== --- 1.3/specific_fns/model_free/mf_minimise.py (original) +++ 1.3/specific_fns/model_free/mf_minimise.py Wed May 9 09:45:24 2012 @@ -31,6 +31,7 @@ from warnings import warn # relax module imports. +import arg_check from float import isNaN, isInf from generic_fns import diffusion_tensor, pipes from generic_fns.diffusion_tensor import diff_data_exists @@ -39,7 +40,7 @@ from multi import Processor_box from multi_processor_commands import MF_grid_command, MF_memo, MF_minimise_command from physical_constants import h_bar, mu0, return_gyromagnetic_ratio -from relax_errors import RelaxError, RelaxInfError, RelaxLenError, RelaxNaNError, RelaxNoModelError, RelaxNoPdbError, RelaxNoResError, RelaxNoSequenceError, RelaxNoTensorError, RelaxNoValueError, RelaxNoVectorsError, RelaxNucleusError, RelaxProtonTypeError, RelaxSpinTypeError +from relax_errors import RelaxError, RelaxInfError, RelaxLenError, RelaxMultiVectorError, RelaxNaNError, RelaxNoModelError, RelaxNoPdbError, RelaxNoResError, RelaxNoSequenceError, RelaxNoTensorError, RelaxNoValueError, RelaxNoVectorsError, RelaxNucleusError, RelaxProtonTypeError, RelaxSpinTypeError from relax_warnings import RelaxWarning @@ -1273,6 +1274,10 @@ # Test if unit vectors exist. if model_type != 'local_tm' and cdp.diff_tensor.type != 'sphere' and not hasattr(spin, 'xh_vect'): raise RelaxNoVectorsError + + # Test if multiple unit vectors exist. + if model_type != 'local_tm' and cdp.diff_tensor.type != 'sphere' and hasattr(spin, 'xh_vect') and arg_check.is_num_list(spin.xh_vect[0]): + raise RelaxMultiVectorError # Test if the spin type has been set. if not hasattr(spin, 'heteronuc_type'):