mailr27773 - /trunk/pipe_control/align_tensor.py


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

Header


Content

Posted by edward on March 04, 2015 - 14:34:
Author: bugman
Date: Wed Mar  4 14:34:07 2015
New Revision: 27773

URL: http://svn.gna.org/viewcvs/relax?rev=27773&view=rev
Log:
Modified the pipe_control.align_tensor.align_data_exists() function to handle 
no tensor IDs.

If no tensor ID is supplied, this will then return True if any alignment data 
exists.


Modified:
    trunk/pipe_control/align_tensor.py

Modified: trunk/pipe_control/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/align_tensor.py?rev=27773&r1=27772&r2=27773&view=diff
==============================================================================
--- trunk/pipe_control/align_tensor.py  (original)
+++ trunk/pipe_control/align_tensor.py  Wed Mar  4 14:34:07 2015
@@ -44,15 +44,15 @@
 from pipe_control.pipes import check_pipe
 
 
-def align_data_exists(tensor, pipe=None):
+def align_data_exists(tensor=None, pipe=None):
     """Function for determining if alignment data exists in the current data 
pipe.
 
-    @param tensor:  The alignment tensor identification string.
-    @type tensor:   str
-    @param pipe:    The data pipe to search for data in.
-    @type pipe:     str
-    @return:        The answer to the question.
-    @rtype:         bool
+    @keyword tensor:    The alignment tensor ID string.  If not supplied, 
then any alignment data will result in the function returning True.
+    @type tensor:       str or None
+    @keyword pipe:      The data pipe to search for data in.  This defaults 
to the current data pipe if not supplied.
+    @type pipe:         str or None
+    @return:            The answer to the question.
+    @rtype:             bool
     """
 
     # The data pipe to check.
@@ -64,6 +64,8 @@
 
     # Test if an alignment tensor corresponding to the arg 'tensor' exists.
     if hasattr(pipe, 'align_tensors'):
+        if tensor == None:
+            return True
         for data in pipe.align_tensors:
             if data.name == tensor:
                 return True




Related Messages


Powered by MHonArc, Updated Wed Mar 04 15:00:02 2015