mailr27084 - /trunk/pipe_control/structure/main.py


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

Header


Content

Posted by edward on December 11, 2014 - 11:37:
Author: bugman
Date: Thu Dec 11 11:37:33 2014
New Revision: 27084

URL: http://svn.gna.org/viewcvs/relax?rev=27084&view=rev
Log:
Converted the structure.superimpose user function to the new 
pipes/models/molecules/atom_id design.

The user function arguments have not changed, however the backend now uses 
the new
pipe_control.structure.main.assemble_coordinates() function.  This is to 
simply decrease the number
of failure points possible in the structure user functions.  The change has 
no effect on the user
function use or results.


Modified:
    trunk/pipe_control/structure/main.py

Modified: trunk/pipe_control/structure/main.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=27084&r1=27083&r2=27084&view=diff
==============================================================================
--- trunk/pipe_control/structure/main.py        (original)
+++ trunk/pipe_control/structure/main.py        Thu Dec 11 11:37:33 2014
@@ -1103,33 +1103,12 @@
     if centre_type not in allowed:
         raise RelaxError("The superimposition centre type '%s' is unknown.  
It must be one of %s." % (centre_type, allowed))
 
-    # Test if the current data pipe exists.
-    check_pipe()
-
-    # Validate the models.
-    cdp.structure.validate_models()
-
     # Create a list of all models.
     if models == None:
-        models = []
-        for model in cdp.structure.model_loop():
-            models.append(model.num)
-
-    # The selection object.
-    selection = cdp.structure.selection(atom_id=atom_id)
-
-    # Assemble the atomic coordinates of all models.
-    coord = []
-    for model in models:
-        coord.append([])
-        for pos in cdp.structure.atom_loop(selection=selection, 
model_num=model, pos_flag=True):
-            coord[-1].append(pos[0])
-        coord[-1] = array(coord[-1])
-
-    # Assemble the element types.
-    elements = []
-    for elem in cdp.structure.atom_loop(selection=selection, 
model_num=model, element_flag=True):
-        elements.append(elem)
+        models = cdp.structure.model_list()
+
+    # Assemble the atomic coordinates and obtain the corresponding element 
information.
+    coord, ids, elements = assemble_coordinates(models=[models], 
atom_id=atom_id, elements_flag=True)
 
     # The different algorithms.
     if method == 'fit to mean':




Related Messages


Powered by MHonArc, Updated Thu Dec 11 12:00:03 2014