Author: bugman Date: Thu Jan 29 17:50:31 2015 New Revision: 27365 URL: http://svn.gna.org/viewcvs/relax?rev=27365&view=rev Log: Created the Internal_selection.count_atoms() internal structural object selection method. This counts the number of atoms in the current selection. 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=27365&r1=27364&r2=27365&view=diff ============================================================================== --- trunk/lib/structure/internal/selection.py (original) +++ trunk/lib/structure/internal/selection.py Thu Jan 29 17:50:31 2015 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2014 Edward d'Auvergne # +# Copyright (C) 2014-2015 Edward d'Auvergne # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # @@ -66,6 +66,12 @@ self._atom_indices.append([]) + def count_atoms(self): + """Return the number of atoms in the selection.""" + + return len(self._atom_indices) + + def loop(self): """Fast loop over all molecule and atom indices.