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.
_______________________________________________
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