Author: bugman Date: Thu Mar 3 15:08:14 2011 New Revision: 12783 URL: http://svn.gna.org/viewcvs/relax?rev=12783&view=rev Log: Improved the argument checking for the relax_data.back_calc() user function. Modified: 1.3/generic_fns/relax_data.py Modified: 1.3/generic_fns/relax_data.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/relax_data.py?rev=12783&r1=12782&r2=12783&view=diff ============================================================================== --- 1.3/generic_fns/relax_data.py (original) +++ 1.3/generic_fns/relax_data.py Thu Mar 3 15:08:14 2011 @@ -70,8 +70,12 @@ if not exists_mol_res_spin_data(): raise RelaxNoSequenceError + # Check that ri_type and frq are supplied if no relaxation data exists. + if ri_id and (not hasattr(cdp, 'ri_ids') or ri_id not in cdp.ri_ids) and (ri_type == None or frq == None): + raise RelaxError("The 'ri_type' and 'frq' arguments must be supplied as no relaxation data corresponding to '%s' exists." % ri_id) + # Check if the type is valid. - if ri_type not in VALID_TYPES: + if ri_type and ri_type not in VALID_TYPES: raise RelaxError("The relaxation data type '%s' must be one of %s." % (ri_type, VALID_TYPES)) # Initialise the global data for the current pipe if necessary.