mailr26915 - /branches/frame_order_cleanup/specific_analyses/frame_order/checks.py


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

Header


Content

Posted by edward on December 03, 2014 - 14:48:
Author: bugman
Date: Wed Dec  3 14:48:46 2014
New Revision: 26915

URL: http://svn.gna.org/viewcvs/relax?rev=26915&view=rev
Log:
Added the pipe_name argument to the frame order check_model() function.

This is for the specific_analyses.frame_order.checks module.


Modified:
    branches/frame_order_cleanup/specific_analyses/frame_order/checks.py

Modified: branches/frame_order_cleanup/specific_analyses/frame_order/checks.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/specific_analyses/frame_order/checks.py?rev=26915&r1=26914&r2=26915&view=diff
==============================================================================
--- branches/frame_order_cleanup/specific_analyses/frame_order/checks.py      
  (original)
+++ branches/frame_order_cleanup/specific_analyses/frame_order/checks.py      
  Wed Dec  3 14:48:46 2014
@@ -65,9 +65,11 @@
     return defined
 
 
-def check_model(escalate=0):
+def check_model(pipe_name=None, escalate=0):
     """Check if the frame order model has been set up.
 
+    @keyword pipe_name:     The data pipe to check for, if not the current 
pipe.
+    @type pipe_name:        None or str
     @keyword escalate:      The feedback to give if the model is not set up. 
 This can be 0 for no printouts, 1 to throw a RelaxWarning, or 2 to raise a 
RelaxError.
     @type escalate:         int
     @raises RelaxError:     If escalate is set to 2 and the model is not set 
up.
@@ -104,27 +106,34 @@
     @rtype:                 bool
     """
 
+    # The data pipe.
+    if pipe_name == None:
+        pipe_name = cdp_name()
+
+    # Get the data pipe.
+    dp = get_pipe(pipe_name)
+
     # Init.
     flag = True
     msg = ''
     missing = []
 
     # The model has not been set up.
-    if not hasattr(cdp, 'params'):
+    if not hasattr(dp, 'params'):
         flag = False
         msg = "The frame order model has not been set up, no parameters have 
been defined."
 
     # The model has been set up.
     else:
         # Loop over all parameters.
-        for param in cdp.params:
+        for param in dp.params:
             # Check that the parameters exists.
-            if not hasattr(cdp, param):
+            if not hasattr(dp, param):
                 missing.append(param)
 
             # Check that it has a value.
             else:
-                obj = getattr(cdp, param)
+                obj = getattr(dp, param)
                 if obj == None:
                     missing.append(param)
 




Related Messages


Powered by MHonArc, Updated Wed Dec 03 15:20:02 2014