[Numpy-svn] r8331 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Mon Apr 12 22:26:45 CDT 2010


Author: charris
Date: 2010-04-12 22:26:45 -0500 (Mon, 12 Apr 2010)
New Revision: 8331

Modified:
   trunk/numpy/lib/ufunclike.py
Log:
BUG: Deprecate ufunclike.log2 and take it off the __all__ list. It was shadowing
the ufunc of the same name.

Modified: trunk/numpy/lib/ufunclike.py
===================================================================
--- trunk/numpy/lib/ufunclike.py	2010-04-13 03:26:41 UTC (rev 8330)
+++ trunk/numpy/lib/ufunclike.py	2010-04-13 03:26:45 UTC (rev 8331)
@@ -2,9 +2,10 @@
 Module of functions that are like ufuncs in acting on arrays and optionally
 storing results in an output array.
 """
-__all__ = ['fix', 'isneginf', 'isposinf', 'log2']
+__all__ = ['fix', 'isneginf', 'isposinf']
 
 import numpy.core.numeric as nx
+import warnings
 
 def fix(x, y=None):
     """
@@ -177,6 +178,7 @@
 def log2(x, y=None):
     """
     Return the base 2 logarithm of the input array, element-wise.
+    This function is now deprecated, use the np.log2 ufunc instead.
 
     Parameters
     ----------
@@ -201,6 +203,9 @@
     array([ NaN,   1.,   2.])
 
     """
+    msg = "numpy.lib.log2 is deprecated, use np.log2 instead."
+    warnings.warn(msg, DeprecationWarning)
+
     x = nx.asanyarray(x)
     if y is None:
         y = nx.log(x)



More information about the Numpy-svn mailing list