summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorrgommers <ralf.gommers@googlemail.com>2011-03-07 10:40:53 +0800
committerrgommers <ralf.gommers@googlemail.com>2011-03-11 12:27:03 +0800
commitf7a4ff1b9133440133936fa04442e40f8829d1ab (patch)
treed9a73edc2a3155d696268753a8aed694c94171e2 /numpy/lib
parent216799cf9caa654a7cb519091dbd6d432b817e51 (diff)
downloadnumpy-f7a4ff1b9133440133936fa04442e40f8829d1ab.tar.gz
DEP: remove deprecated np.lib.ufunclike.log2 function.
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/tests/test_ufunclike.py13
-rw-r--r--numpy/lib/ufunclike.py42
2 files changed, 1 insertions, 54 deletions
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py
index e9c41d09c..29b47f257 100644
--- a/numpy/lib/tests/test_ufunclike.py
+++ b/numpy/lib/tests/test_ufunclike.py
@@ -27,17 +27,6 @@ class TestUfunclike(TestCase):
assert_equal(res, tgt)
assert_equal(out, tgt)
- @deprecated()
- def test_log2(self):
- a = nx.array([4.5, 2.3, 6.5])
- out = nx.zeros(a.shape, float)
- tgt = nx.array([2.169925, 1.20163386, 2.70043972])
- res = ufl.log2(a)
- assert_almost_equal(res, tgt)
- res = ufl.log2(a, out)
- assert_almost_equal(res, tgt)
- assert_almost_equal(out, tgt)
-
def test_fix(self):
a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]])
out = nx.zeros(a.shape, float)
@@ -64,7 +53,7 @@ class TestUfunclike(TestCase):
m = MyArray(a, metadata='foo')
f = ufl.fix(m)
assert_array_equal(f, nx.array([1,-1]))
- assert isinstance(f, MyArray)
+ assert_(isinstance(f, MyArray))
assert_equal(f.metadata, 'foo')
if __name__ == "__main__":
diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py
index 8f81fe4b2..b51365f41 100644
--- a/numpy/lib/ufunclike.py
+++ b/numpy/lib/ufunclike.py
@@ -172,45 +172,3 @@ def isneginf(x, y=None):
y = nx.empty(x.shape, dtype=nx.bool_)
nx.logical_and(nx.isinf(x), nx.signbit(x), y)
return y
-
-
-_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
- ----------
- x : array_like
- Input array.
- y : array_like
- Optional output array with the same shape as `x`.
-
- Returns
- -------
- y : ndarray
- The logarithm to the base 2 of `x` element-wise.
- NaNs are returned where `x` is negative.
-
- See Also
- --------
- log, log1p, log10
-
- Examples
- --------
- >>> np.log2([-1, 2, 4])
- array([ NaN, 1., 2.])
-
- """
- import warnings
- 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)
- else:
- nx.log(x, y)
- y /= _log2
- return y