mailr8413 - /branches/multi_structure/generic_fns/structure/internal.py


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

Header


Content

Posted by edward on January 12, 2009 - 14:24:
Author: bugman
Date: Mon Jan 12 14:24:35 2009
New Revision: 8413

URL: http://svn.gna.org/viewcvs/relax?rev=8413&view=rev
Log:
Modified __atom_index() to work within the MolContainer.


Modified:
    branches/multi_structure/generic_fns/structure/internal.py

Modified: branches/multi_structure/generic_fns/structure/internal.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/multi_structure/generic_fns/structure/internal.py?rev=8413&r1=8412&r2=8413&view=diff
==============================================================================
--- branches/multi_structure/generic_fns/structure/internal.py (original)
+++ branches/multi_structure/generic_fns/structure/internal.py Mon Jan 12 
14:24:35 2009
@@ -1153,29 +1153,20 @@
         self.z = []
 
 
-    def __atom_index(self, atom_num, struct_index):
+    def __atom_index(self, atom_num):
         """Find the atom index corresponding to the given atom number.
 
         @param atom_num:        The atom number to find the index of.
         @type atom_num:         int
-        @param struct_index:    The index of the structural container to 
extract the atom index
-                                from.
-        @type struct_index:     int
         @return:                The atom index corresponding to the atom.
         @rtype:                 int
         """
 
-        # Loop over the structures.
-        for i in xrange(self.num):
-            # Skip non-matching structures.
-            if struct_index != None and struct_index != i:
-                continue
-
-            # Loop over the atoms.
-            for j in xrange(len(self.structural_data[i].atom_num)):
-                # Return the index.
-                if self.structural_data[i].atom_num[j] == atom_num:
-                    return j
+        # Loop over the atoms.
+        for j in xrange(len(self.atom_num)):
+            # Return the index.
+            if self.atom_num[j] == atom_num:
+                return j
 
         # Should not be here, the PDB connect records are incorrect.
         warn(RelaxWarning("The atom number " + `atom_num` + " from the 
CONECT record cannot be found within the ATOM and HETATM records."))




Related Messages


Powered by MHonArc, Updated Mon Jan 12 14:40:02 2009