Author: bugman Date: Tue Sep 23 18:55:47 2014 New Revision: 25978 URL: http://svn.gna.org/viewcvs/relax?rev=25978&view=rev Log: Created the structural object Internal_selection.mol_loop() method. This is to simply quickly loop over all molecule indices of the selection object. Modified: trunk/lib/structure/internal/selection.py Modified: trunk/lib/structure/internal/selection.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/selection.py?rev=25978&r1=25977&r2=25978&view=diff ============================================================================== --- trunk/lib/structure/internal/selection.py (original) +++ trunk/lib/structure/internal/selection.py Tue Sep 23 18:55:47 2014 @@ -81,3 +81,15 @@ # Atom loop. for atom_index in self._atom_indices[index]: yield mol_index, atom_index + + + def mol_loop(self): + """Fast loop over all molecule indices. + + @return: The molecule index. + @rtype: int + """ + + # Molecule loop. + for mol_index in self._mol_indices: + yield mol_index