diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2010-04-13 03:26:45 +0000 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2010-04-13 03:26:45 +0000 |
commit | 0351ce05794bb62d99ca205b69eeca5f71ad2b6a (patch) | |
tree | 2bfba1583d36e8df31a1a697a40a1f033bf3634f | |
parent | 73651a6ceba09729ee7a28558187ffa7e295dc22 (diff) | |
download | numpy-0351ce05794bb62d99ca205b69eeca5f71ad2b6a.tar.gz |
BUG: Deprecate ufunclike.log2 and take it off the __all__ list. It was shadowing
the ufunc of the same name.
-rw-r--r-- | numpy/lib/ufunclike.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 7432e91ae..acd46010e 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -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 @@ _log2 = nx.log(2) 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 @@ def log2(x, y=None): 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) |