mailr23777 - in /branches/frame_order_cleanup: ./ lib/compat.py sconstruct


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

Header


Content

Posted by edward on June 10, 2014 - 09:46:
Author: bugman
Date: Tue Jun 10 09:46:20 2014
New Revision: 23777

URL: http://svn.gna.org/viewcvs/relax?rev=23777&view=rev
Log:
Merged revisions 23753,23774 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r23753 | tlinnet | 2014-06-09 19:23:21 +0200 (Mon, 09 Jun 2014) | 7 lines
  
  Added searching for enviroment variable PYTHON_INCLUDE_DIR if Python.h is 
not found in
  standard python library.
  
  This can be very handsome, if one has a python virtual enviroment for 
multiple users.
  
  This relates to the wiki page:
  http://wiki.nmr-relax.com/Epd_canopy
........
  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.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/lib/compat.py
    branches/frame_order_cleanup/sconstruct

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun 10 09:46:20 2014
@@ -1 +1 @@
-/trunk:1-23715,23720,23743
+/trunk:1-23776

Modified: branches/frame_order_cleanup/lib/compat.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/compat.py?rev=23777&r1=23776&r2=23777&view=diff
==============================================================================
--- branches/frame_order_cleanup/lib/compat.py  (original)
+++ branches/frame_order_cleanup/lib/compat.py  Tue Jun 10 09:46:20 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/frame_order_cleanup/sconstruct
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/sconstruct?rev=23777&r1=23776&r2=23777&view=diff
==============================================================================
--- branches/frame_order_cleanup/sconstruct     (original)
+++ branches/frame_order_cleanup/sconstruct     Tue Jun 10 09:46:20 2014
@@ -572,6 +572,18 @@
         py_include_minpath = sys.prefix + path.sep + 'include'
         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'
+        if not access(f_name_pyth, F_OK):
+
+            # Test if 'PYTHON_INCLUDE_DIR' has been set to system 
environment.
+            if 'PYTHON_INCLUDE_DIR' in environ:
+
+                # Test if Python.h is here.
+                f_name_pyth = environ['PYTHON_INCLUDE_DIR'] + path.sep + 
'Python.h'
+                if access(f_name_pyth, F_OK):
+                    py_include_fullpath = environ['PYTHON_INCLUDE_DIR']
+
         # Construct the python bin path.
         py_bin_minpath = sys.prefix + path.sep + 'bin'
         py_bin_fullpath = py_bin_minpath + path.sep + 'python' + 
`sys.version_info[0]` + '.' + `sys.version_info[1]`




Related Messages


Powered by MHonArc, Updated Tue Jun 10 10:00:02 2014