Author: bugman Date: Tue Mar 1 18:19:09 2011 New Revision: 12662 URL: http://svn.gna.org/viewcvs/relax?rev=12662&view=rev Log: Converted the relax_data.display() 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=12662&r1=12661&r2=12662&view=diff ============================================================================== --- branches/relax_data/generic_fns/relax_data.py (original) +++ branches/relax_data/generic_fns/relax_data.py Tue Mar 1 18:19:09 2011 @@ -519,13 +519,11 @@ del spin.relax_error[ri_id] -def display(ri_label=None, frq_label=None): - """Display relaxation data corresponding to the Ri and frequency labels. - - @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 +def display(ri_id=None): + """Display relaxation data corresponding to the ID. + + @keyword ri_id: The relaxation data ID string. + @type ri_id: str """ # Test if the current pipe exists. @@ -535,12 +533,12 @@ if not exists_mol_res_spin_data(): raise RelaxNoSequenceError - # Test if data corresponding to 'ri_label' and 'frq_label' 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) # Print the data. - value.write_data(param=(ri_label, frq_label), file=sys.stdout, return_value=return_value) + value.write_data(param=ri_id, file=sys.stdout, return_value=return_value) def find_ri_index(data, ri_label, frq_label): Modified: branches/relax_data/prompt/relax_data.py URL: http://svn.gna.org/viewcvs/relax/branches/relax_data/prompt/relax_data.py?rev=12662&r1=12661&r2=12662&view=diff ============================================================================== --- branches/relax_data/prompt/relax_data.py (original) +++ branches/relax_data/prompt/relax_data.py Tue Mar 1 18:19:09 2011 @@ -125,7 +125,7 @@ def delete(self, ri_id=None): - """Delete the relaxation data corresponding to the relaxation data ID string. + """Delete the data corresponding to the relaxation data ID string. Keyword Arguments ~~~~~~~~~~~~~~~~~ @@ -154,38 +154,34 @@ relax_data.delete(ri_id=ri_id) - def display(self, ri_label=None, frq_label=None): - """Function for displaying the relaxation data corresponding to ri_label and frq_label. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - ri_label: The relaxation data type, ie 'R1', 'R2', or 'NOE'. - - frq_label: The field strength label. + def display(self, ri_id=None): + """Display the data corresponding to the relaxation data ID string. + + Keyword Arguments + ~~~~~~~~~~~~~~~~~ + + ri_id: The relaxation data ID string. Examples ~~~~~~~~ - To display the NOE relaxation data at 600 MHz, type: - - relax> relax_data.display('NOE', '600') + To display the NOE relaxation data at 600 MHz with the ID string 'NOE_600', type: + + relax> relax_data.display('NOE_600') """ # Function intro text. if self._exec_info.intro: text = self._exec_info.ps3 + "relax_data.display(" - text = text + "ri_label=" + repr(ri_label) - text = text + ", frq_label=" + repr(frq_label) + ")" - print(text) - - # The argument checks. - arg_check.is_str(ri_label, 'relaxation label') - arg_check.is_str(frq_label, 'frequency label') - - # Execute the functional code. - relax_data.display(ri_label=ri_label, frq_label=frq_label) + text = text + "ri_id=" + repr(ri_id) + ")" + print(text) + + # The argument checks. + arg_check.is_str(ri_id, 'relaxation data ID string') + + # Execute the functional code. + relax_data.display(ri_id=ri_id) def peak_intensity_type(self, ri_label=None, frq_label=None, type=None):