mailr27365 - /trunk/lib/structure/internal/selection.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 29, 2015 - 17:50:
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.
 




Related Messages


Powered by MHonArc, Updated Thu Jan 29 18:00:02 2015