Author: semor Date: Mon Jan 12 14:27:11 2009 New Revision: 8415 URL: http://svn.gna.org/viewcvs/relax?rev=8415&view=rev Log: Added tests, print statements and other code to the relaxation dispersion specific functions. Tests were proosed by Ed in a post at: https://mail.gna.org/public/relax-devel/2009-01/msg00065.html (Message-id: <7f080ed10901120107t4f1cd53ew51f498a45a38eade@xxxxxxxxxxxxxx>) Modified: branches/relax_disp/specific_fns/relax_disp.py Modified: branches/relax_disp/specific_fns/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_fns/relax_disp.py?rev=8415&r1=8414&r2=8415&view=diff ============================================================================== --- branches/relax_disp/specific_fns/relax_disp.py (original) +++ branches/relax_disp/specific_fns/relax_disp.py Mon Jan 12 14:27:11 2009 @@ -245,6 +245,9 @@ @type delayT: float """ + # Test if the current data pipe exists. + pipes.test + # Alias the current data pipe. cdp = pipes.get_pipe() @@ -252,12 +255,26 @@ if not hasattr(cdp, 'delayT'): cdp.delayT = {} + # Test if the pipe type is set to 'relax_disp'. + function_type = cdp.pipe_type + if function_type != 'relax_disp': + raise RelaxFuncSetupError, specific_setup.get_string(function_type) + + # Test if sequence data is loaded. + if not exists_mol_res_spin_data(): + raise RelaxNoSequenceError + + # Make sure the experiment type is set to 'cpmg'. + if not cdp.exp_type == 'cpmg': + raise RelaxError, "To use the function cpmg_delay(), the experiment type must be set to 'cpmg'." + # Test the CPMG constant time delay (T) has not already been set. if cdp.delayT.has_key(id): raise RelaxError, "The CPMG constant time delay (T) for the experiment " + `id` + " has already been set." # Set the CPMG constant time delay (T). cdp.delayT[id] = delayT + print "The CPMG delay T for experiment " + `id` + " has been set to " + `cdp.delayT[id]` + " s." def create_mc_data(self, spin_id): @@ -540,11 +557,12 @@ # CPMG relaxation dispersion experiments. if exp == 'cpmg': print "CPMG relaxation dispersion experiments." + cdp.exp_type = 'cpmg' # R1rho relaxation dispersion experiments. elif exp == 'r1rho': - #print "R1rho relaxation dispersion experiments." - raise RelaxError, "R1rho relaxation dispersion experiments have not been implemented yet." + print "R1rho relaxation dispersion experiments." + cdp.exp_type = 'r1rho' # Invalid relaxation dispersion experiment. else: @@ -1156,6 +1174,10 @@ if not exists_mol_res_spin_data(): raise RelaxNoSequenceError + # Test if the experiment type is set. + if not hasattr(cdp, 'exp_type'): + raise RelaxError, "The relaxation dispersion experiment type has not been set." + # Fast-exchange regime. if model == 'fast': print "Fast-exchange regime."