Author: bugman Date: Wed Nov 13 11:12:12 2013 New Revision: 21416 URL: http://svn.gna.org/viewcvs/relax?rev=21416&view=rev Log: Added the return_id argument to the pipe_control.mol_res_spin.pseudoatom_loop() function. This will then yield both the spin container and spin ID string. This mimics the spin_loop() function. Modified: trunk/pipe_control/mol_res_spin.py Modified: trunk/pipe_control/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/mol_res_spin.py?rev=21416&r1=21415&r2=21416&view=diff ============================================================================== --- trunk/pipe_control/mol_res_spin.py (original) +++ trunk/pipe_control/mol_res_spin.py Wed Nov 13 11:12:12 2013 @@ -2379,13 +2379,15 @@ return seq -def pseudoatom_loop(spin=None): +def pseudoatom_loop(spin=None, return_id=False): """Loop over the atoms of the given pseudo-atom spin container. - @keyword spin: The pseudo-atom spin container. - @type spin: SpinContainer instance - @return: The spins of the pseudo-atom. - @rtype: SpinContainer instance + @keyword spin: The pseudo-atom spin container. + @type spin: SpinContainer instance + @keyword return_id: A flag which if True will cause the spin identification string of the current spin to be returned in addition to the spin container. + @type return_id: bool + @return: The spins of the pseudo-atom. + @rtype: SpinContainer instance """ # Check for the 'members' data structure. @@ -2394,8 +2396,14 @@ # Loop over the members. for spin_id in spin.members: - # Yield the spin containers. - yield return_spin(spin_id=spin_id) + # Get the spin container. + spin = return_spin(spin_id=spin_id) + + # Yield the data. + if return_id: + yield spin, spin_id + else: + yield spin def residue_loop(selection=None, pipe=None, full_info=False, return_id=False):