Author: bugman Date: Tue Nov 12 19:45:04 2013 New Revision: 21409 URL: http://svn.gna.org/viewcvs/relax?rev=21409&view=rev Log: Created the pipe_control.mol_res_spin.is_pseudoatom() function to simplify pseudo-atom handling. 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=21409&r1=21408&r2=21409&view=diff ============================================================================== --- trunk/pipe_control/mol_res_spin.py (original) +++ trunk/pipe_control/mol_res_spin.py Tue Nov 12 19:45:04 2013 @@ -1590,6 +1590,23 @@ # Return the IDs. return spin_ids + + +def is_pseudoatom(spin=None): + """Check if the given spin container corresponds to a pseudo-atom. + + @keyword spin: The spin container to check. + @type spin: SpinContainer instance + @return: True if this is a pseudo-atom, False otherwise. + @rtype: bool + """ + + # Check for the 'members' data structure. + if hasattr(spin, 'members'): + return True + + # Normal atom. + return False def index_molecule(mol_name=None, pipe=None):