diff options
| author | Matti Picus <matti.picus@gmail.com> | 2020-11-09 23:22:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-09 23:22:37 +0200 |
| commit | e77b53a880edf16808488084c67ef090c69b3258 (patch) | |
| tree | 9ff4f78ffd476f99a39b8cf9b3273b89be2302df | |
| parent | dd1f2146254a5cb6d3d05823de06785634e0f8b9 (diff) | |
| parent | 0e894153d7ac241c770286bd8c100c9c269dc44e (diff) | |
| download | numpy-e77b53a880edf16808488084c67ef090c69b3258.tar.gz | |
Merge pull request #17733 from WarrenWeckesser/ma-no-options
MAINT: ma: Remove unused `**options` from MaskedArray `__new__` method.
| -rw-r--r-- | numpy/ma/core.py | 2 | ||||
| -rw-r--r-- | numpy/ma/tests/test_core.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py index 89294e403..4fb7d8c28 100644 --- a/numpy/ma/core.py +++ b/numpy/ma/core.py @@ -2812,7 +2812,7 @@ class MaskedArray(ndarray): def __new__(cls, data=None, mask=nomask, dtype=None, copy=False, subok=True, ndmin=0, fill_value=None, keep_mask=True, - hard_mask=None, shrink=True, order=None, **options): + hard_mask=None, shrink=True, order=None): """ Create a new masked array from scratch. diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 6a2ed8ca7..0b2e7303c 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -244,6 +244,10 @@ class TestMaskedArray: 'offsets':[0,8]}) array(x) # used to fail due to 'V' padding field in x.dtype.descr + def test_unknown_keyword_parameter(self): + with pytest.raises(TypeError, match="unexpected keyword argument"): + MaskedArray([1, 2, 3], maks=[0, 1, 0]) # `mask` is misspelled. + def test_asarray(self): (x, y, a10, m1, m2, xm, ym, z, zm, xf) = self.d xm.fill_value = -9999 @@ -4601,7 +4605,7 @@ class TestMaskedArrayFunctions: class M(MaskedArray): pass - test = np.ma.compressed(M(shape=(0,1,2))) + test = np.ma.compressed(M([[[]], [[]]])) assert_equal(test.ndim, 1) # with .compressed() overridden @@ -4609,7 +4613,7 @@ class TestMaskedArrayFunctions: def compressed(self): return 42 - test = np.ma.compressed(M(shape=(0,1,2))) + test = np.ma.compressed(M([[[]], [[]]])) assert_equal(test, 42) def test_convolve(self): |
