mailr25976 - /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 September 23, 2014 - 18:21:
Author: bugman
Date: Tue Sep 23 18:21:42 2014
New Revision: 25976

URL: http://svn.gna.org/viewcvs/relax?rev=25976&view=rev
Log:
Fixes for the new structural object Internal_selection object.

The atom indices are not stored via the molecule index.


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=25976&r1=25975&r2=25976&view=diff
==============================================================================
--- trunk/lib/structure/internal/selection.py   (original)
+++ trunk/lib/structure/internal/selection.py   Tue Sep 23 18:21:42 2014
@@ -24,7 +24,7 @@
 
 
 class Internal_selection:
-    """The fast structural selection object.""" 
+    """The fast structural selection object."""
 
     def __init__(self):
         """Set up the object."""
@@ -45,8 +45,11 @@
         @type atom_index:       int
         """
 
+        # Find the molecule index.
+        index = self._mol_indices.index(mol_index)
+
         # Store the index.
-        self._atom_indices[mol_index].append(atom_index)
+        self._atom_indices[index].append(atom_index)
 
 
     def add_mol(self, mol_index=None):
@@ -72,6 +75,9 @@
 
         # Molecule loop.
         for mol_index in self._mol_indices:
+            # Find the molecule index.
+            index = self._mol_indices.index(mol_index)
+
             # Atom loop.
-            for atom_index in self._atom_indices[mol_index]:
+            for atom_index in self._atom_indices[index]:
                 yield mol_index, atom_index




Related Messages


Powered by MHonArc, Updated Tue Sep 23 19:00:04 2014