summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2019-07-30 15:40:39 -0700
committerGitHub <noreply@github.com>2019-07-30 15:40:39 -0700
commitf12c63297fecdff294af209032d0690c6c2a1c0d (patch)
tree29f59596c5c267ef501f4f2dbcc3292736278985 /numpy
parent0ea69d67643a4a57d91700a9ee9687d33784a052 (diff)
parent4e68aba658a6e54d09150f093cdb6f9d4883b081 (diff)
downloadnumpy-f12c63297fecdff294af209032d0690c6c2a1c0d.tar.gz
Merge pull request #14145 from eric-wieser/fix-14140
BUG: Remove the broken clip wrapper
Diffstat (limited to 'numpy')
-rw-r--r--numpy/ma/core.py1
-rw-r--r--numpy/ma/tests/test_core.py7
2 files changed, 7 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 796677139..8641819ff 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5887,7 +5887,6 @@ class MaskedArray(ndarray):
return out[()]
# Array methods
- clip = _arraymethod('clip', onmask=False)
copy = _arraymethod('copy')
diagonal = _arraymethod('diagonal')
flatten = _arraymethod('flatten')
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 9fe550ef8..b72ce56aa 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -3035,6 +3035,13 @@ class TestMaskedArrayMethods(object):
assert_equal(clipped._data, x.clip(2, 8))
assert_equal(clipped._data, mx._data.clip(2, 8))
+ def test_clip_out(self):
+ # gh-14140
+ a = np.arange(10)
+ m = np.ma.MaskedArray(a, mask=[0, 1] * 5)
+ m.clip(0, 5, out=m)
+ assert_equal(m.mask, [0, 1] * 5)
+
def test_compress(self):
# test compress
a = masked_array([1., 2., 3., 4., 5.], fill_value=9999)