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
_______________________________________________
relax (http://www.nmr-relax.com)
This is the relax-commits mailing list
[email protected]
To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits