Author: bugman Date: Tue Mar 1 18:25:19 2011 New Revision: 12665 URL: http://svn.gna.org/viewcvs/relax?rev=12665&view=rev Log: Converted the relax_data.temp_calibration() user function back and front end to the new design. Modified: branches/relax_data/generic_fns/relax_data.py branches/relax_data/prompt/relax_data.py Modified: branches/relax_data/generic_fns/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_data/generic_fns/relax_data.py?rev=12665&r1=12664&r2=12665&view=diff ============================================================================== --- branches/relax_data/generic_fns/relax_data.py (original) +++ branches/relax_data/generic_fns/relax_data.py Tue Mar 1 18:25:19 2011 @@ -779,14 +779,12 @@ return spin.ri_data[data_type], spin.ri_data_err[data_type] -def temp_calibration(ri_label=None, frq_label=None, method=None): +def temp_calibration(ri_id=None, method=None): """Set the temperature calibration method. - @param ri_label: The relaxation data type, ie 'R1', 'R2', or 'NOE'. - @type ri_label: str - @param frq_label: The field strength label. - @type frq_label: str - @param method: The temperature calibration method. + @keyword ri_id: The relaxation data type, ie 'R1', 'R2', or 'NOE'. + @type ri_id: str + @keyword method: The temperature calibration method. @type method: str """ @@ -797,10 +795,9 @@ if not exists_mol_res_spin_data(): raise RelaxNoSequenceError - # Test if relaxation data corresponding to 'ri_label' and 'frq_label' already exists. - if not test_labels(ri_label, frq_label): - raise RelaxNoRiError(ri_label, frq_label) - + # Test if data exists. + if not hasattr(cdp, 'ri_ids') or ri_id not in cdp.ri_ids: + raise RelaxNoRiError(ri_id) # Check the values, and warn if not in the list. valid = ['methanol', 'monoethylene glycol', 'no calibration applied'] @@ -812,7 +809,7 @@ cdp.exp_info = ExpInfo() # Store the method. - cdp.exp_info.temp_calibration_setup(ri_label, frq_label, method) + cdp.exp_info.temp_calibration_setup(ri_id, method) Modified: branches/relax_data/prompt/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_data/prompt/relax_data.py?rev=12665&r1=12664&r2=12665&view=diff ============================================================================== --- branches/relax_data/prompt/relax_data.py (original) +++ branches/relax_data/prompt/relax_data.py Tue Mar 1 18:25:19 2011 @@ -341,15 +341,13 @@ relax_data.read(ri_id=ri_id, ri_type=ri_type, frq=frq, file=file, dir=dir, spin_id_col=spin_id_col, mol_name_col=mol_name_col, res_num_col=res_num_col, res_name_col=res_name_col, spin_num_col=spin_num_col, spin_name_col=spin_name_col, data_col=data_col, error_col=error_col, sep=sep, spin_id=spin_id) - def temp_calibration(self, ri_label=None, frq_label=None, method=None): + def temp_calibration(self, ri_id=None, method=None): """Specify the temperature calibration method used. Keyword Arguments ~~~~~~~~~~~~~~~~~ - ri_label: The relaxation data type, ie 'R1', 'R2', or 'NOE'. - - frq_label: The field strength label. + ri_id: The relaxation data ID string. method: The calibration method. @@ -370,18 +368,16 @@ # Function intro text. if self._exec_info.intro: text = self._exec_info.ps3 + "relax_data.temp_calibration(" - text = text + "ri_label=" + repr(ri_label) - text = text + ", frq_label=" + repr(frq_label) + text = text + "ri_id=" + repr(ri_id) text = text + ", method=" + repr(method) + ")" print(text) # The argument checks. - arg_check.is_str(ri_label, 'relaxation label') - arg_check.is_str(frq_label, 'frequency label') + arg_check.is_str(ri_id, 'relaxation label') arg_check.is_str(method, 'temperature calibration method') # Execute the functional code. - relax_data.temp_calibration(ri_label=ri_label, frq_label=frq_label, method=method) + relax_data.temp_calibration(ri_id=ri_id, method=method) def temp_control(self, ri_label=None, frq_label=None, method=None):