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 - 18:29:
Hmmm, that's very strange!  I see the messages below.  These tests
should not pass as lib.spectrum.nmrpipe imports dep_check, but this is
not in lib, breaking the independence of lib and hence the test should
fail.  The dep_check module, or any non-relax library module can never
be imported into the lib package.

Regards,

Edward


[edward@localhost relax-trunk]$ ./relax --verification-tests


===============================
= Software verification tests =
===============================

F.
======================================================================
FAIL: test_library_independence 
(test_suite.verification_tests.library.Library)
Throughly check the independence of the relax library by importing it
from a non-relax directory.
----------------------------------------------------------------------
Package 'lib.alignment'.
  Module 'lib.alignment.alignment_tensor'.
  Module 'lib.alignment.paramag_centre'.
  Module 'lib.alignment.pcs'.
  Module 'lib.alignment.rdc'.
Module 'lib.ansi'.
Module 'lib.arg_check'.
Package 'lib.auto_relaxation'.
  Module 'lib.auto_relaxation.ri'.
  Module 'lib.auto_relaxation.ri_comps'.
  Module 'lib.auto_relaxation.ri_prime'.
Module 'lib.check_types'.
Package 'lib.chemical_shift'.
Module 'lib.compat'.
Package 'lib.curve_fit'.
  Module 'lib.curve_fit.exponential'.
Package 'lib.diffusion'.
  Module 'lib.diffusion.correlation_time'.
  Module 'lib.diffusion.direction_cosine'.
  Module 'lib.diffusion.main'.
  Module 'lib.diffusion.weights'.
Package 'lib.dispersion'.
  Module 'lib.dispersion.b14'.
  Module 'lib.dispersion.cr72'.
  Module 'lib.dispersion.dpl94'.
  Module 'lib.dispersion.it99'.
  Module 'lib.dispersion.lm63'.
  Module 'lib.dispersion.lm63_3site'.
  Module 'lib.dispersion.m61'.
  Module 'lib.dispersion.m61b'.
  Module 'lib.dispersion.matrix_exponential'.
  Module 'lib.dispersion.matrix_power'.
  Module 'lib.dispersion.mmq_cr72'.
  Module 'lib.dispersion.mp05'.
  Module 'lib.dispersion.ns_cpmg_2site_3d'.
  Module 'lib.dispersion.ns_cpmg_2site_expanded'.
  Module 'lib.dispersion.ns_cpmg_2site_star'.
  Module 'lib.dispersion.ns_matrices'.
  Module 'lib.dispersion.ns_mmq_2site'.
  Module 'lib.dispersion.ns_mmq_3site'.
  Module 'lib.dispersion.ns_r1rho_2site'.
  Module 'lib.dispersion.ns_r1rho_3site'.
  Module 'lib.dispersion.tap03'.
  Module 'lib.dispersion.tp02'.
  Module 'lib.dispersion.tsmfk01'.
  Module 'lib.dispersion.two_point'.
Module 'lib.errors'.
Module 'lib.float'.
Package 'lib.frame_order'.
  Module 'lib.frame_order.double_rotor'.
  Module 'lib.frame_order.format'.
  Module 'lib.frame_order.free_rotor'.
  Module 'lib.frame_order.iso_cone'.
  Module 'lib.frame_order.iso_cone_free_rotor'.
  Module 'lib.frame_order.iso_cone_torsionless'.
  Module 'lib.frame_order.matrix_ops'.
  Module 'lib.frame_order.pseudo_ellipse'.
  Module 'lib.frame_order.pseudo_ellipse_free_rotor'.
  Module 'lib.frame_order.pseudo_ellipse_torsionless'.
  Module 'lib.frame_order.rotor'.
  Module 'lib.frame_order.rotor_axis'.
Package 'lib.geometry'.
  Module 'lib.geometry.angles'.
  Module 'lib.geometry.coord_transform'.
  Module 'lib.geometry.lines'.
  Module 'lib.geometry.pec'.
  Module 'lib.geometry.rotations'.
  Module 'lib.geometry.vectors'.
Module 'lib.io'.
Package 'lib.linear_algebra'.
  Module 'lib.linear_algebra.kronecker_product'.
  Module 'lib.linear_algebra.matrix_exponential'.
  Module 'lib.linear_algebra.matrix_power'.
Module 'lib.list'.
Module 'lib.mathematics'.
Module 'lib.model_selection'.
Module 'lib.nmr'.
Package 'lib.order'.
  Module 'lib.order.order_parameters'.
Module 'lib.periodic_table'.
Module 'lib.physical_constants'.
Module 'lib.regex'.
Module 'lib.selection'.
Module 'lib.sequence'.
Package 'lib.software'.
  Module 'lib.software.bruker_dc'.
  Module 'lib.software.grace'.
  Package 'lib.software.opendx'.
    Module 'lib.software.opendx.execute'.
    Module 'lib.software.opendx.files'.
  Module 'lib.software.xplor'.
Package 'lib.spectral_densities'.
  Module 'lib.spectral_densities.model_free'.
  Module 'lib.spectral_densities.model_free_components'.
Package 'lib.spectrum'.
  Module 'lib.spectrum.nmrpipe'.
  Module 'lib.spectrum.nmrview'.
  Module 'lib.spectrum.objects'.
  Module 'lib.spectrum.peak_list'.
  Module 'lib.spectrum.sparky'.
  Module 'lib.spectrum.xeasy'.
Module 'lib.statistics'.
Package 'lib.structure'.
  Module 'lib.structure.angles'.
  Module 'lib.structure.cones'.
  Module 'lib.structure.conversion'.
  Module 'lib.structure.files'.
  Module 'lib.structure.geometric'.
  Package 'lib.structure.internal'.
    Module 'lib.structure.internal.displacements'.
    Module 'lib.structure.internal.models'.
    Module 'lib.structure.internal.molecules'.
    Module 'lib.structure.internal.object'.
  Module 'lib.structure.mass'.
  Module 'lib.structure.pdb_read'.
  Module 'lib.structure.pdb_write'.
  Package 'lib.structure.represent'.
    Module 'lib.structure.represent.cone'.
    Module 'lib.structure.represent.diffusion_tensor'.
    Module 'lib.structure.represent.rotor'.
  Module 'lib.structure.statistics'.
  Module 'lib.structure.superimpose'.
Package 'lib.text'.
  Module 'lib.text.gui'.
  Module 'lib.text.sectioning'.
  Module 'lib.text.string'.
  Module 'lib.text.table'.
Module 'lib.timing'.
Module 'lib.warnings'.
Module 'lib.xml'.


Import failures:
  lib.spectrum.nmrpipe:  No module named dep_check
  lib.spectrum.peak_list:  No module named dep_check





Import failures:

  lib.spectrum.nmrpipe:  No module named dep_check

  lib.spectrum.peak_list:  No module named dep_check



Traceback (most recent call last):
  File "/data/relax/relax-trunk/test_suite/verification_tests/library.py",
line 224, in test_library_independence
    self.fail()
AssertionError: None

----------------------------------------------------------------------
Ran 2 tests in 0.246s

FAILED (failures=1)


===================================
= Summary of the relax test suite =
===================================



Optional packages/modules
=========================

No tests skipped due to missing modules.



Synopsis
========

Software verification tests
............................................................. [ Failed
]



[edward@localhost relax-trunk]$

On 18 September 2014 18:13, Troels Emtekær Linnet <tlinnet@xxxxxxxxxxxxx> 
wrote:
I get this?

[tlinnet@tomat relax_trunk]$ relax_tomat --verification-te


===============================
= Software verification tests =
===============================

..
----------------------------------------------------------------------
Ran 2 tests in 0.755s

OK


===================================
= Summary of the relax test suite =
===================================



Optional packages/modules
=========================

No tests skipped due to missing modules.



Synopsis
========

Software verification tests
................................................................. [ OK
]

2014-09-18 17:44 GMT+02:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:
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

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

This is the relax-devel mailing list
relax-devel@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-devel



Related Messages


Powered by MHonArc, Updated Fri Sep 19 09:40:12 2014