Author: bugman Date: Mon Sep 17 13:58:27 2012 New Revision: 17483 URL: http://svn.gna.org/viewcvs/relax?rev=17483&view=rev Log: Fix for bug #20173 (https://gna.org/bugs/?20173). The palmer.create user function should have been checking that the diffusion tensor had been initialised. This is now being performed. Modified: trunk/generic_fns/palmer.py Modified: trunk/generic_fns/palmer.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/palmer.py?rev=17483&r1=17482&r2=17483&view=diff ============================================================================== --- trunk/generic_fns/palmer.py (original) +++ trunk/generic_fns/palmer.py Mon Sep 17 13:58:27 2012 @@ -35,7 +35,7 @@ from generic_fns.mol_res_spin import exists_mol_res_spin_data, spin_loop from generic_fns import diffusion_tensor, pipes from physical_constants import return_gyromagnetic_ratio -from relax_errors import RelaxError, RelaxDirError, RelaxFileError, RelaxNoInteratomError, RelaxNoModelError, RelaxNoPdbError, RelaxNoSequenceError +from relax_errors import RelaxError, RelaxDirError, RelaxFileError, RelaxNoInteratomError, RelaxNoModelError, RelaxNoPdbError, RelaxNoSequenceError, RelaxNoTensorError from relax_io import mkdir_nofail, open_write_file, test_binary from specific_fns.setup import model_free_obj @@ -263,6 +263,10 @@ @type frq: list of float """ + # Check for the diffusion tensor. + if not hasattr(cdp, 'diff_tensor'): + raise RelaxNoTensorError('diffusion') + # Set the diffusion tensor specific values. if cdp.diff_tensor.type == 'sphere': diff = 'isotropic' @@ -501,6 +505,10 @@ @type dir: str """ + # Check for the diffusion tensor. + if not hasattr(cdp, 'diff_tensor'): + raise RelaxNoTensorError('diffusion') + file.write("#! /bin/sh\n") file.write(binary + " -i mfin -d mfdata -p mfpar -m mfmodel -o mfout -e out") if cdp.diff_tensor.type != 'sphere': @@ -527,6 +535,10 @@ @type binary: str """ + # Check for the diffusion tensor. + if not hasattr(cdp, 'diff_tensor'): + raise RelaxNoTensorError('diffusion') + # The current directory. orig_dir = getcwd() @@ -614,6 +626,10 @@ # Test if sequence data is loaded. if not exists_mol_res_spin_data(): raise RelaxNoSequenceError + + # Check for the diffusion tensor. + if not hasattr(cdp, 'diff_tensor'): + raise RelaxNoTensorError('diffusion') # The directory. if dir == None: