mailRe: r25603 - /trunk/lib/spectrum/nmrpipe.py


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

Header


Content

Posted by Edward d'Auvergne on September 18, 2014 - 17:44:
Hi Troels,

When you have some spare time, could you have a look and fix this test
suite failure you introduced into the relax trunk?  This blocks the
software verification tests in the branches (specifically the
frame_order_cleanup branch I am working on).  And it blocks a new
stable version of relax from being able to be released.

Cheers,

Edward


On 12 September 2014 14:51, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
Hi Troels,

I can identify this commit as the reason why the software verification
tests fail.  The dep_check module is not part of the relax library so
you cannot use it here.  Instead just import the subprocess module in
a try statement (like in the dep_check module).  You can then create
your own subprocess_module flag for this lib module and avoid the
dep_check module.

Cheers,

Edward

On 3 September 2014 22:50,  <tlinnet@xxxxxxxxxxxxx> wrote:
Author: tlinnet
Date: Wed Sep  3 22:50:33 2014
New Revision: 25603

URL: http://svn.gna.org/viewcvs/relax?rev=25603&view=rev
Log:
To the lib function of spectrum.nmrpipe, added function to call the 
NMRPipe program showApod, to get the output from the program.

Modified:
    trunk/lib/spectrum/nmrpipe.py

Modified: trunk/lib/spectrum/nmrpipe.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/spectrum/nmrpipe.py?rev=25603&r1=25602&r2=25603&view=diff
==============================================================================
--- trunk/lib/spectrum/nmrpipe.py       (original)
+++ trunk/lib/spectrum/nmrpipe.py       Wed Sep  3 22:50:33 2014
@@ -28,8 +28,14 @@
 from warnings import warn

 # relax module imports.
+import dep_check
 from lib.errors import RelaxError
+from lib.io import get_file_path
 from lib.warnings import RelaxWarning
+
+# Check subprocess is available.
+if dep_check.subprocess_module:
+    import subprocess


 def read_seriestab(peak_list=None, file_data=None, int_col=None):
@@ -185,3 +191,35 @@

         # Add the assignment to the peak list object.
         peak_list.add(res_nums=[res_num1, res_num2], 
res_names=[res_name1, res_name2], spin_names=[name1, name2], shifts=[w1, 
w2], intensity=intensities, intensity_name=spectra)
+
+
+def show_apod_extract(file_name=None, dir=None, 
path_to_command='showApod'):
+    """Extract showApod information for spectrum fourier transformed with 
NMRPipe.
+
+    @keyword file:              The filename of the NMRPipe fourier 
transformed file.
+    @type file:                 str
+    @keyword dir:               The directory where the file is located.
+    @type dir:                  str
+    @keyword path_to_command:   If showApod not in PATH, then specify 
absolute path as: /path/to/showApod
+    @type dir:                  str
+    @return:                    The output from showApod as list of lines.
+    @rtype:                     list of lines
+    """
+
+    # Get the file path.
+    file_path = get_file_path(file_name=file_name, dir=dir)
+
+    if dep_check.subprocess_module:
+        # Call function.
+        Temp=subprocess.Popen([path_to_command, file_path], 
stdout=subprocess.PIPE)
+
+        # Communicate with program, and get outout and exitcode.
+        (output, errput) = Temp.communicate()
+
+        # Wait for finish and get return code.
+        return_value = Temp.wait()
+
+        return output.splitlines()
+
+    else:
+        raise RelaxError("python module 'subprocess' not found.  Cannot 
call showApod.")


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

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



Related Messages


Powered by MHonArc, Updated Thu Sep 18 18:20:19 2014