Author: bugman Date: Thu Mar 3 10:20:24 2011 New Revision: 12755 URL: http://svn.gna.org/viewcvs/relax?rev=12755&view=rev Log: Alphabetical ordering of functions in the relax_data module. Modified: branches/relax_data/generic_fns/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=12755&r1=12754&r2=12755&view=diff ============================================================================== --- branches/relax_data/generic_fns/relax_data.py (original) +++ branches/relax_data/generic_fns/relax_data.py Thu Mar 3 10:20:24 2011 @@ -339,27 +339,6 @@ star.experiment.add(name=exp_label, spectrometer_ids=spectro_ids, spectrometer_labels=spectro_labels) -def frq_loop(): - """Generator function for returning each unique frequency. - - @return: The frequency. - @rtype: float - """ - - # Init. - frq = [] - - # Loop over the Rx data. - for ri_id in cdp.ri_ids: - # New frequency. - if cdp.frq[ri_id] not in frq: - # Add the frequency. - frq.append(cdp.frq[ri_id]) - - # Yield the value. - yield cdp.frq[ri_id] - - def copy(pipe_from=None, pipe_to=None, ri_id=None): """Copy the relaxation data from one data pipe to another. @@ -441,6 +420,74 @@ spin_to.ri_data_err[ri_id] = spin_from.ri_data_err[ri_id] +def delete(ri_id=None): + """Delete relaxation data corresponding to the relaxation data ID. + + @keyword ri_id: The relaxation data ID string. + @type ri_id: str + """ + + # Test if the current pipe exists. + pipes.test() + + # Test if the sequence data is loaded. + if not exists_mol_res_spin_data(): + raise RelaxNoSequenceError + + # Test if data exists. + if not hasattr(cdp, 'ri_ids') or ri_id not in cdp.ri_ids: + raise RelaxNoRiError(ri_id) + + # Loop over the spins. + for spin in spin_loop(): + # Relaxation data and errors. + del spin.ri_data[ri_id] + del spin.ri_data_err[ri_id] + + +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. + pipes.test() + + # Test if the sequence data is loaded. + if not exists_mol_res_spin_data(): + raise RelaxNoSequenceError + + # 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_id, file=sys.stdout, return_value=return_value) + + +def frq_loop(): + """Generator function for returning each unique frequency. + + @return: The frequency. + @rtype: float + """ + + # Init. + frq = [] + + # Loop over the Rx data. + for ri_id in cdp.ri_ids: + # New frequency. + if cdp.frq[ri_id] not in frq: + # Add the frequency. + frq.append(cdp.frq[ri_id]) + + # Yield the value. + yield cdp.frq[ri_id] + + def get_data_names(global_flag=False, sim_names=False): """Return a list of names of data structures associated with relaxation data. @@ -486,53 +533,6 @@ # Return the list of names. return names - - -def delete(ri_id=None): - """Delete relaxation data corresponding to the relaxation data ID. - - @keyword ri_id: The relaxation data ID string. - @type ri_id: str - """ - - # Test if the current pipe exists. - pipes.test() - - # Test if the sequence data is loaded. - if not exists_mol_res_spin_data(): - raise RelaxNoSequenceError - - # Test if data exists. - if not hasattr(cdp, 'ri_ids') or ri_id not in cdp.ri_ids: - raise RelaxNoRiError(ri_id) - - # Loop over the spins. - for spin in spin_loop(): - # Relaxation data and errors. - del spin.ri_data[ri_id] - del spin.ri_data_err[ri_id] - - -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. - pipes.test() - - # Test if the sequence data is loaded. - if not exists_mol_res_spin_data(): - raise RelaxNoSequenceError - - # 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_id, file=sys.stdout, return_value=return_value) def pack_data(ri_id, ri_type, frq, values, errors, spin_ids=None, mol_names=None, res_nums=None, res_names=None, spin_nums=None, spin_names=None, gen_seq=False):