mailr23262 - /trunk/extern/numpy_future.py


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

Header


Content

Posted by edward on May 20, 2014 - 17:50:
Author: bugman
Date: Tue May 20 17:50:10 2014
New Revision: 23262

URL: http://svn.gna.org/viewcvs/relax?rev=23262&view=rev
Log:
Python 3 fixes for the extern.numpy_future module.

These changes are necessary to allow relax to even run.


Modified:
    trunk/extern/numpy_future.py

Modified: trunk/extern/numpy_future.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/extern/numpy_future.py?rev=23262&r1=23261&r2=23262&view=diff
==============================================================================
--- trunk/extern/numpy_future.py        (original)
+++ trunk/extern/numpy_future.py        Tue May 20 17:50:10 2014
@@ -1,6 +1,7 @@
 
#####################################################################################################################################################
 #                                                                            
                                                                       #
 # Copyright (c) 2005-2013, NumPy Developers.                                 
                                                                         #
+# Copyright (c) 2014 Edward d'Auvergne                                       
                                                                       #
 #                                                                            
                                                                       #
 # All rights reserved.                                                       
                                                                       #
 #                                                                            
                                                                       #
@@ -124,8 +125,7 @@
 
     if overwrite_input:
         if axis is None:
-            sorted = a.ravel()
-            sorted.sort()
+            sorted = sorted(a.ravel())
         else:
             a.sort(axis=axis)
             sorted = a
@@ -154,7 +154,7 @@
 
     q = q / 100.0
     if (q < 0) or (q > 1):
-        raise ValueError, "percentile must be either in the range [0,100]"
+        raise ValueError("percentile must be either in the range [0,100]")
 
     indexer = [slice(None)] * sorted.ndim
     Nx = sorted.shape[axis]
@@ -167,7 +167,7 @@
     else:
         indexer[axis] = slice(i, i+2)
         j = i + 1
-        weights = array([(j - index), (index - i)],float)
+        weights = array([(j - index), (index - i)], float)
         wshape = [1]*sorted.ndim
         wshape[axis] = 2
         weights.shape = wshape




Related Messages


Powered by MHonArc, Updated Tue May 20 18:20:03 2014