mailr6791 - in /1.3/generic_fns/structure: api_base.py main.py scientific.py


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

Header


Content

Posted by edward on July 07, 2008 - 14:37:
Author: bugman
Date: Mon Jul  7 14:27:55 2008
New Revision: 6791

URL: http://svn.gna.org/viewcvs/relax?rev=6791&view=rev
Log:
Renamed the structural object method bond_vectors() model arg to struct_index.


Modified:
    1.3/generic_fns/structure/api_base.py
    1.3/generic_fns/structure/main.py
    1.3/generic_fns/structure/scientific.py

Modified: 1.3/generic_fns/structure/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/api_base.py?rev=6791&r1=6790&r2=6791&view=diff
==============================================================================
--- 1.3/generic_fns/structure/api_base.py (original)
+++ 1.3/generic_fns/structure/api_base.py Mon Jul  7 14:27:55 2008
@@ -184,7 +184,7 @@
         raise RelaxImplementError
 
 
-    def bond_vectors(self, atom_id=None, attached_atom=None, model=None):
+    def bond_vectors(self, atom_id=None, attached_atom=None, 
struct_index=None):
         """Prototype method stub for finding the bond vectors between 
'attached_atom' and 'atom_id'.
 
         @keyword atom_id:       The molecule, residue, and atom identifier 
string.  This must
@@ -192,10 +192,10 @@
         @type atom_id:          str
         @keyword attached_atom: The name of the bonded atom.
         @type attached_atom:    str
-        @keyword model:         The model to return the vectors information 
from.  If not
-                                supplied and multiple models exist, then the 
returned data will
-                                contain the vectors for all models.
-        @type model:            None or int
+        @keyword struct_index:  The index of the structure to return the 
vectors from.  If not
+                                supplied and multiple structures/models 
exist, then vectors from all
+                                structures will be returned.
+        @type struct_index:     None or int
         @return:                The list of bond vectors for each model.
         @rtype:                 list of numpy arrays
         """

Modified: 1.3/generic_fns/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=6791&r1=6790&r2=6791&view=diff
==============================================================================
--- 1.3/generic_fns/structure/main.py (original)
+++ 1.3/generic_fns/structure/main.py Mon Jul  7 14:27:55 2008
@@ -288,7 +288,7 @@
             continue
 
         # Get the bond info.
-        bond_vectors = cdp.structure.bond_vectors(atom_id=id, 
attached=attached, struct_index=struct_index)
+        bond_vectors = cdp.structure.bond_vectors(atom_id=id, 
attached_atom=attached, struct_index=struct_index)
 
         # No attached atom.
         if not bond_vectors:

Modified: 1.3/generic_fns/structure/scientific.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/scientific.py?rev=6791&r1=6790&r2=6791&view=diff
==============================================================================
--- 1.3/generic_fns/structure/scientific.py (original)
+++ 1.3/generic_fns/structure/scientific.py Mon Jul  7 14:27:55 2008
@@ -353,7 +353,7 @@
         return bonded_num, bonded_name, element, pos_array
 
 
-    def bond_vectors(self, atom_id=None, attached_atom=None, model=None):
+    def bond_vectors(self, atom_id=None, attached_atom=None, 
struct_index=None):
         """Find the bond vectors between the atoms of 'attached_atom' and 
'atom_id'.
 
         @keyword atom_id:       The molecule, residue, and atom identifier 
string.  This must
@@ -361,11 +361,12 @@
         @type atom_id:          str
         @keyword attached_atom: The name of the bonded atom.
         @type attached_atom:    str
-        @keyword model:         The model to return the vectors information 
from.  If not
-                                supplied and multiple models exist, then the 
returned data will
-                                contain the vectors for all models.
-        @type model:            None or int
-        @return:                The list of bond vectors for each model.
+        @keyword struct_index:  The index of the structure to return the 
vectors from.  If not
+                                supplied and multiple structures/models 
exist, then vectors from all
+                                structures will be returned.
+        @type struct_index:     None or int
+        @type struct_index:     None or int.
+        @return:                The list of bond vectors for each structure.
         @rtype:                 list of numpy arrays
         """
 
@@ -375,14 +376,14 @@
         # Initialise some objects.
         vectors = []
 
-        # Loop over the models.
-        for struct in self.structural_data:
+        # Loop over the structures.
+        for i in xrange(len(self.structural_data)):
+            # Single structure.
+            if struct_index and struct_index != i:
+                continue
+
             # Init.
             atom_found = False
-
-            # Skip non-matching models.
-            if model != None and model != struct.model:
-                continue
 
             # Loop over each individual molecule.
             for mol, mol_name, mol_type in self.__molecule_loop(struct, 
sel_obj):
@@ -410,7 +411,7 @@
 
             # Found the atom.
             if atom_found:
-                # Find the atom bonded to this model/molecule/residue/atom.
+                # Find the atom bonded to this 
structure/molecule/residue/atom.
                 bonded_num, bonded_name, element, pos = 
self.__find_bonded_atom(attached_atom, mol_type_match, res_match)
 
                 # No bonded atom.




Related Messages


Powered by MHonArc, Updated Mon Jul 07 15:00:15 2008