mailr26114 - /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 October 01, 2014 - 19:44:
Author: bugman
Date: Wed Oct  1 19:44:27 2014
New Revision: 26114

URL: http://svn.gna.org/viewcvs/relax?rev=26114&view=rev
Log:
The pipe_control.structure.main.check_structure() checking object now accepts 
the pipe_name argument.

This allows structural data to be checked for in different data pipes without 
having to switch to
them.

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=26114&r1=26113&r2=26114&view=diff
==============================================================================
--- trunk/pipe_control/structure/main.py        (original)
+++ trunk/pipe_control/structure/main.py        Wed Oct  1 19:44:27 2014
@@ -230,23 +230,30 @@
             rotate(R=R[i], origin=pivot[i], model=model, 
pipe_name=pipes[pipe_index])
 
 
-def check_structure_func():
+def check_structure_func(pipe_name=None):
     """Test if structural data is present.
 
     @return:        The initialised RelaxError object or nothing.
     @rtype:         None or RelaxError instance
     """
 
+    # Defaults.
+    if pipe_name == None:
+        pipe_name = cdp_name()
+
+    # Get the data pipe.
+    dp = get_pipe(pipe_name)
+
     # Test if the structure exists.
-    if not hasattr(cdp, 'structure'):
+    if not hasattr(dp, 'structure'):
         return RelaxError("No structural data is present in the current data 
pipe.")
 
     # Check for models:
-    if not cdp.structure.num_models():
+    if not dp.structure.num_models():
         return RelaxError("The structural object in the current data pipe 
contains no models.")
 
     # Check for molecules.
-    if not cdp.structure.num_molecules():
+    if not dp.structure.num_molecules():
         return RelaxError("The structural object in the current data pipe 
contains no molecules.")
 
 # Create the checking object.




Related Messages


Powered by MHonArc, Updated Wed Oct 01 20:00:03 2014