Author: bugman Date: Mon Apr 22 10:51:14 2013 New Revision: 19579 URL: http://svn.gna.org/viewcvs/relax?rev=19579&view=rev Log: Elimination of the relax_disp.cpmg_delayT user function. This user function is not necessary as the relax_disp.relax_time user function serves the same purpose. The use of relax_disp.relax_time instead allows for code sharing between the fixed and variable time period relaxation dispersion experiment types. Modified: branches/relax_disp/gui/wizards/peak_intensity.py branches/relax_disp/specific_analyses/relax_disp.py branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py branches/relax_disp/user_functions/relax_disp.py Modified: branches/relax_disp/gui/wizards/peak_intensity.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/gui/wizards/peak_intensity.py?rev=19579&r1=19578&r2=19579&view=diff ============================================================================== --- branches/relax_disp/gui/wizards/peak_intensity.py (original) +++ branches/relax_disp/gui/wizards/peak_intensity.py Mon Apr 22 10:51:14 2013 @@ -64,7 +64,7 @@ @type relax_fit: bool @keyword relax_disp: A flag which when True will enable the relaxation dispersion portions of the wizard. @type relax_disp: bool - @keyword relax_disp_cpmg: A flag which if True enables the relax_disp.cpmg_delayT and relax_disp.cpmg_frq user functions and if False enables the relax_disp.spin_lock_field user function. + @keyword relax_disp_cpmg: A flag which if True enables the relax_disp.cpmg_frq user function and if False enables the relax_disp.spin_lock_field user function. @type relax_disp_cpmg: bool @keyword relax_disp_times: A flag which if True will enable the relax_disp.relax_time page. @type relax_disp_times: bool @@ -155,12 +155,6 @@ # CPMG pages. if self.relax_disp_cpmg: - # The relax_disp.cpmg_delayT page. - if not self.relax_disp_times: - page = uf_store['relax_disp.cpmg_delayT'].create_page(self, sync=True) - self.page_indices['cpmg_delayT'] = self.add_page(page, skip_button=True, proceed_on_error=False) - page.on_init = self.wizard_update_relax_disp_cpmg_delayT - # The relax_disp.cpmg_frq page. page = uf_store['relax_disp.cpmg_frq'].create_page(self, sync=True) self.page_indices['cpmg_frq'] = self.add_page(page, skip_button=False, proceed_on_error=False) @@ -299,13 +293,6 @@ # Update the spectrum ID. self.wizard_update_ids(page_key='pts') - - - def wizard_update_relax_disp_cpmg_delayT(self): - """Update the relax_disp.cpmg_delayT page based on previous data.""" - - # Update the spectrum ID. - self.wizard_update_ids(page_key='cpmg_delayT') def wizard_update_relax_disp_cpmg_frq(self): Modified: branches/relax_disp/specific_analyses/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/specific_analyses/relax_disp.py?rev=19579&r1=19578&r2=19579&view=diff ============================================================================== --- branches/relax_disp/specific_analyses/relax_disp.py (original) +++ branches/relax_disp/specific_analyses/relax_disp.py Mon Apr 22 10:51:14 2013 @@ -458,44 +458,6 @@ # Return the IDs. return ids - - - def _cpmg_delayT(self, spectrum_id=None, delayT=None): - """Set the CPMG constant time delay (T) of the experiment. - - @keyword spectrum_id: The spectrum ID string. - @type spectrum_id: str - @keyword delayT: The CPMG constant time delay (T) in s. - @type delayT: float - """ - - # Test if the current data pipe exists. - pipes.test() - - # Set up the dictionnary data structure if it doesn't exist yet. - 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' or 'cpmg fixed'. - if not cdp.exp_type[:4] == 'cpmg': - raise RelaxError("To use this user function, 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(spectrum_id): - raise RelaxError("The CPMG constant time delay (T) for the spectrum '%s' has already been set." % spectrum_id) - - # Set the CPMG constant time delay (T). - cdp.delayT[spectrum_id] = delayT - print("The CPMG delay T for the spectrum '%s' has been set to %s s." % (spectrum_id, cdp.delayT[spectrum_id])) def _cpmg_frq(self, spectrum_id=None, cpmg_frq=None): Modified: branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py?rev=19579&r1=19578&r2=19579&view=diff ============================================================================== --- branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py (original) +++ branches/relax_disp/test_suite/unit_tests/_prompt/test_relax_disp.py Mon Apr 22 10:51:14 2013 @@ -114,32 +114,6 @@ self.assertRaises(RelaxNumError, self.relax_disp_fns.calc_r2eff, id='test', int_cpmg=10, int_ref=data[1]) - def test_relax_cpmg_delayT_argfail_id(self): - """The id arg test of the relax_disp.relax_cpmg_delayT() user function.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the str arguments, and skip them. - if data[0] == 'str': - continue - - # The argument test. - self.assertRaises(RelaxStrError, self.relax_disp_fns.cpmg_delayT, id=data[1]) - - - def test_relax_cpmg_delayT_argfail_delayT(self): - """The delayT arg test of the relax_disp.cpmg_delayT() user function.""" - - # Loop over the data types. - for data in DATA_TYPES: - # Catch the float, int and None arguments, and skip them. - if data[0] == 'float' or data[0] == 'int' or data[0] == 'None': - continue - - # The argument test. - self.assertRaises(RelaxNumError, self.relax_disp_fns.cpmg_delayT, id='test', delayT=data[1]) - - def test_relax_cpmg_frq_argfail_cpmg_frq(self): """The cpmg_frq arg test of the relax_disp.cpmg_frq() user function.""" Modified: branches/relax_disp/user_functions/relax_disp.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_disp/user_functions/relax_disp.py?rev=19579&r1=19578&r2=19579&view=diff ============================================================================== --- branches/relax_disp/user_functions/relax_disp.py (original) +++ branches/relax_disp/user_functions/relax_disp.py Mon Apr 22 10:51:14 2013 @@ -153,35 +153,6 @@ uf.menu_text = "c&luster" uf.wizard_height_desc = 500 uf.wizard_size = (800, 600) - - -# The relax_disp.cpmg_delayT user function. -uf = uf_info.add_uf('relax_disp.cpmg_delayT') -uf.title = "Set the CPMG constant time delay (T) of the experiment." -uf.title_short = "CPMG time delay." -uf.add_keyarg( - name = "spectrum_id", - py_type = "str", - desc_short = "spectrum ID", - desc = "The spectrum identification string." -) -uf.add_keyarg( - name = "delayT", - py_type = "num", - desc_short = "CPMG time delay", - desc = "The CPMG constant time delay (T) in s." -) -# Description. -uf.desc.append(Desc_container()) -uf.desc[-1].add_paragraph("This allows the CPMG constant time delay (T) of a given experiment or spectrum to be set.") -# Prompt examples. -uf.desc.append(Desc_container("Prompt examples")) -uf.desc[-1].add_paragraph("To set a CPMG constant time delay T of 20 ms (0.020 s) for experiments '600', type one of:") -uf.desc[-1].add_prompt("relax> relax_disp.cpmg_delayT('600', 0.020)") -uf.desc[-1].add_prompt("relax> relax_disp.cpmg_delayT(id='600', delayT=0.020)") -uf.backend = relax_disp_obj._cpmg_delayT -uf.menu_text = "&cpmg_delayT" -uf.wizard_size = (800, 500) # The relax_disp.cpmg_frq user function.