mailr23786 - in /branches/disp_spin_speed: ./ lib/ scons/ test_suite/system_tests/ test_suite/unit_tests/_lib/


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

Header


Content

Posted by tlinnet on June 10, 2014 - 12:26:
Author: tlinnet
Date: Tue Jun 10 12:26:28 2014
New Revision: 23786

URL: http://svn.gna.org/viewcvs/relax?rev=23786&view=rev
Log:
Merged revisions 23774,23779-23781,23784-23785 via svnmerge from 
svn+ssh://tlinnet@xxxxxxxxxxx/svn/relax/trunk

........
  r23774 | bugman | 2014-06-10 09:40:22 +0200 (Tue, 10 Jun 2014) | 6 lines
  
  The lib.compat.norm() replacement function for numpy.linalg.norm() now 
handles no axis argument.
  
  This is to allow the function to be used in all cases where 
numpy.linalg.norm() is used, while
  providing compatibility with the axis argument and all numpy versions.
........
  r23779 | bugman | 2014-06-10 10:07:22 +0200 (Tue, 10 Jun 2014) | 6 lines
  
  Fix for the scons target for compiling the relax manual when using a 
repository checkout copy.
  
  The method for compiling the relax manual was calling the 
version.revision() function, however this
  has been replaced a while ago by the version.repo_revision variable.
........
  r23780 | bugman | 2014-06-10 10:08:33 +0200 (Tue, 10 Jun 2014) | 6 lines
  
  Created two unit tests for the lib.io.file_root() function.
  
  The second of the tests demonstrate a failure of the function if multiple 
file extensions are
  present.
........
  r23781 | bugman | 2014-06-10 10:13:29 +0200 (Tue, 10 Jun 2014) | 5 lines
  
  Bug fix for the lib.io.file_root() function for multiple file extensions.
  
  The function will now strip off all file extensions.
........
  r23784 | tlinnet | 2014-06-10 11:49:00 +0200 (Tue, 10 Jun 2014) | 7 lines
  
  Lowered chi2 value test in system test 
Relax_disp.test_bug_22146_unpacking_r2a_r2b_cluster_NS_STAR.
  
  This is due to the data produced on 32 bit machine, and tested on 64 bit 
machines.
  The error was:
  AssertionError: 2.4659455670347743e-05 != 0.0 within 7 places
  
  The reason for this is due to truncation artifacts.
........
  r23785 | tlinnet | 2014-06-10 12:23:01 +0200 (Tue, 10 Jun 2014) | 5 lines
  
  Fix for wrong path testing of Python.h.
  
  Python.h would be in PYTHON_PREFIX/include/pythonX.Y/Python.h
  and not in:
  PYTHON_PREFIX/include/Python.h
........

Modified:
    branches/disp_spin_speed/   (props changed)
    branches/disp_spin_speed/lib/compat.py
    branches/disp_spin_speed/lib/io.py
    branches/disp_spin_speed/scons/manuals.py
    branches/disp_spin_speed/sconstruct
    branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
    branches/disp_spin_speed/test_suite/unit_tests/_lib/test_io.py

Propchange: branches/disp_spin_speed/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun 10 12:26:28 2014
@@ -1 +1 @@
-/trunk:1-23758
+/trunk:1-23785

Modified: branches/disp_spin_speed/lib/compat.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/compat.py?rev=23786&r1=23785&r2=23786&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/compat.py      (original)
+++ branches/disp_spin_speed/lib/compat.py      Tue Jun 10 12:26:28 2014
@@ -237,13 +237,16 @@
     @type axis:     {int, 2-tuple of ints, None}, optional
     """
 
+    # No axis argument given.
+    if axis == None:
+        return numpy.linalg.norm(x, ord=ord)
+
     # The axis argument exists.
     if numpy_norm_axis:
         return numpy.linalg.norm(x, ord=ord, axis=axis)
 
     # Support for older version (this is much slower).
-    else:
-        return numpy.apply_along_axis(numpy.linalg.norm, axis, x)
+    return numpy.apply_along_axis(numpy.linalg.norm, axis, x)
 
 
 def sorted(data):

Modified: branches/disp_spin_speed/lib/io.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/lib/io.py?rev=23786&r1=23785&r2=23786&view=diff
==============================================================================
--- branches/disp_spin_speed/lib/io.py  (original)
+++ branches/disp_spin_speed/lib/io.py  Tue Jun 10 12:26:28 2014
@@ -165,8 +165,13 @@
     @rtype:             str
     """
 
-    root, ext = splitext(file_path)
-    return basename(root)
+    # Loop over all file extensions, stopping when none are left.
+    ext = None
+    while ext != '':
+        file_path, ext = splitext(file_path)
+
+    # Return the file root with the directories stripped.
+    return basename(file_path)
 
 
 def get_file_path(file_name=None, dir=None):

Modified: branches/disp_spin_speed/scons/manuals.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/scons/manuals.py?rev=23786&r1=23785&r2=23786&view=diff
==============================================================================
--- branches/disp_spin_speed/scons/manuals.py   (original)
+++ branches/disp_spin_speed/scons/manuals.py   Tue Jun 10 12:26:28 2014
@@ -503,7 +503,7 @@
     # Add the repository revision if not a normal release.
     text = version.version
     if text == 'repository checkout':
-        text += ' r%s' % version.revision()
+        text += ' r%s' % version.repo_revision
 
     # Place the program version number into a LaTeX file.
     file = open(env['LATEX_DIR'] + sep + 'relax_version.tex', 'w')

Modified: branches/disp_spin_speed/sconstruct
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/sconstruct?rev=23786&r1=23785&r2=23786&view=diff
==============================================================================
--- branches/disp_spin_speed/sconstruct (original)
+++ branches/disp_spin_speed/sconstruct Tue Jun 10 12:26:28 2014
@@ -573,7 +573,7 @@
         py_include_fullpath = py_include_minpath + path.sep + 'python' + 
`sys.version_info[0]` + '.' + `sys.version_info[1]`
 
         # Test if Python.h resides here.
-        f_name_pyth = py_include_minpath + path.sep + 'Python.h'
+        f_name_pyth = py_include_fullpath + path.sep + 'Python.h'
         if not access(f_name_pyth, F_OK):
 
             # Test if 'PYTHON_INCLUDE_DIR' has been set to system 
environment.

Modified: branches/disp_spin_speed/test_suite/system_tests/relax_disp.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/system_tests/relax_disp.py?rev=23786&r1=23785&r2=23786&view=diff
==============================================================================
--- branches/disp_spin_speed/test_suite/system_tests/relax_disp.py      
(original)
+++ branches/disp_spin_speed/test_suite/system_tests/relax_disp.py      Tue 
Jun 10 12:26:28 2014
@@ -78,7 +78,7 @@
         self.tmpdir = ds.tmpdir
 
 
-    def setup_bug_22146_unpacking_r2a_r2b_cluster(self, folder=None, 
model_analyse=None):
+    def setup_bug_22146_unpacking_r2a_r2b_cluster(self, folder=None, 
model_analyse=None, places = 7):
         """Setup data for the catch of U{bug 
#22146<https://gna.org/bugs/?22146>}, the failure of unpacking R2A and R2B, 
when performing a clustered full dispersion models.
 
         @keyword folder:            The name of the folder for the test data.
@@ -231,7 +231,7 @@
 
             # Test chi2.
             # At this point the chi-squared value at the solution should be 
zero, as the relaxation data was created with the same parameter values.
-            self.assertAlmostEqual(cur_spin.chi2, 0.0)
+            self.assertAlmostEqual(cur_spin.chi2, 0.0, places = places)
 
 
     def setup_hansen_cpmg_data(self, model=None):
@@ -1014,7 +1014,7 @@
         """Catch U{bug #22146<https://gna.org/bugs/?22146>}, the failure of 
unpacking R2A and R2B, when performing a clustered NS CPMG 2SITE STAR full 
analysis."""
 
         # Base data setup.
-        
self.setup_bug_22146_unpacking_r2a_r2b_cluster(folder='ns_cpmg_2site_star_full',
 model_analyse = MODEL_NS_CPMG_2SITE_STAR_FULL)
+        
self.setup_bug_22146_unpacking_r2a_r2b_cluster(folder='ns_cpmg_2site_star_full',
 model_analyse = MODEL_NS_CPMG_2SITE_STAR_FULL, places = 4)
 
 
     def test_cpmg_synthetic_ns3d_to_cr72(self):

Modified: branches/disp_spin_speed/test_suite/unit_tests/_lib/test_io.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/disp_spin_speed/test_suite/unit_tests/_lib/test_io.py?rev=23786&r1=23785&r2=23786&view=diff
==============================================================================
--- branches/disp_spin_speed/test_suite/unit_tests/_lib/test_io.py      
(original)
+++ branches/disp_spin_speed/test_suite/unit_tests/_lib/test_io.py      Tue 
Jun 10 12:26:28 2014
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2007-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -29,6 +29,28 @@
 
 class Test_io(TestCase):
     """Unit tests for the functions of the 'lib.io' module."""
+
+
+    def test_file_root(self):
+        """Test the lib.io.file_root() function with '/tmp/test.xyz'."""
+
+        # The data.
+        file = '/tmp/test.xyz'
+        root = 'test'
+
+        # Check the function.
+        self.assertEqual(lib.io.file_root(file), root)
+
+
+    def test_file_root2(self):
+        """Test the lib.io.file_root() function with '/tmp/test.xyz.gz'."""
+
+        # The data.
+        file = '/tmp/test.xyz.gz'
+        root = 'test'
+
+        # Check the function.
+        self.assertEqual(lib.io.file_root(file), root)
 
 
     def test_get_file_path(self):




Related Messages


Powered by MHonArc, Updated Tue Jun 10 17:00:03 2014