Skip to content

Commit

Permalink
ENH: Adding __array_ufunc__ capability to MaskedArrays.
Browse files Browse the repository at this point in the history
This enables any ufunc numpy operations that are called on a
MaskedArray to use the masked version of that function automatically
without needing to resort to np.ma.func() calls.
  • Loading branch information
greglucas committed Jan 3, 2023
1 parent 196705a commit ab732d0
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 47 deletions.
2 changes: 1 addition & 1 deletion numpy/lib/tests/test_function_base.py
Expand Up @@ -786,7 +786,7 @@ def test_subclass(self):
mask=[[False, False], [True, False],
[False, True], [True, True], [False, False]])
out = diff(x)
assert_array_equal(out.data, [[1], [1], [1], [1], [1]])
assert_array_equal(out.data, [[1], [4], [6], [8], [1]])
assert_array_equal(out.mask, [[False], [True],
[True], [True], [False]])
assert_(type(out) is type(x))
Expand Down

0 comments on commit ab732d0

Please sign in to comment.