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 19, 2014 - 10:40:
Hi,

The trunk breakages are rather important.  For example you reported a
possible problem with the relax_disp.r20_from_min_R2eff user function.
If that is true, I will instantly release a new relax version once a
fix is in place.  The breakage has been in trunk now for 16 days, so I
was forced to eliminate it.  It was also blocking my testing of the
frame_order_cleanup branch.  Another important point is that long time
breakages in the test suite, even within a branch, block the important
debugging process of bisecting (using 'svn up -r...' to find the
commit before and after the breakage).  Bisecting is extremely
powerful for finding the exact commit which introduced a bug - that is
how I found that r25603 was the breakage point here.  But if a second
change broke the library independence after the first one did, then it
is impossible to find this second breakage using bisecting.

For the test, it makes no difference where you run it from.  The
Library.test_library_independence verification test copies the entire
lib directory into the system's temporary directory, then creates a
Python script to import all modules of the lib package one-by-one, and
executes the script with an external 2nd instance of Python (the same
Python executable as relax is running).  It was failing in all cases
on my system.

Regards,

Edward



On 19 September 2014 09:59, Troels Emtekær Linnet <tlinnet@xxxxxxxxxxxxx> 
wrote:
Hi Edward.

I keep a "to do" email folder, with stuff I should fix in relax.
There were 3 items, now there is 2.

I ran the test inside the relax folder.
Could that have an influence on the possibility to import files?

Best
Troels

2014-09-19 9:25 GMT+02:00 Edward d'Auvergne <edward@xxxxxxxxxxxxx>:
Hi Troels,

I have fixed this myself.  It was rather basic:
http://thread.gmane.org/gmane.science.nmr.relax.scm/23657.  Next time
there is a change in trunk which causes the test suite to fail, and no
fixes are forthcoming, I will just have to revert the change that
broke the trunk.  I try to keep the trunk in a 100% functional state
so that I can fix bugs reported by users and can release a new relax
version within a day (if the bug is urgent enough).  If there are
disruptive changes planned, just create a quick branch.  Working on
your auto-analysis is ok, as the auto-analyses are quite isolated from
the rest of relax.  But please don't break the trunk again.

If the software verification test did not fail, the relax library
independence can be tested by checking out the library by itself:

$ svn co http://svn.gna.org/svn/relax/trunk/lib@r25904 ~/tmp/lib_test
$ cd ~/tmp
$ python
import lib_test
from lib_test.spectrum import nmrpipe

That is the revision before the fix.  These command should work, but I
see an ImportError.  I cannot work out why the test did not fail for
you.  On which operating system was this?  Maybe I need to check how
well the software verification tests are set up for different
operating systems.

Cheers,

Edward



On 18 September 2014 18:28, Edward d'Auvergne <edward@xxxxxxxxxxxxx> wrote:
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 Tue Sep 23 19:40:14 2014