8000 ENH: Adding __array_ufunc__ capability to MaskedArrays (again) by greglucas · Pull Request #22914 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Adding __array_ufunc__ capability to MaskedArrays (again) #22914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
ab732d0
ENH: Adding __array_ufunc__ capability to MaskedArrays.
greglucas Apr 15, 2020
63df460
DOC: Adding improvement note for MaskedArray ufunc
greglucas Apr 14, 2021
a63e97a
nomask in nomask out
rcomer Jul 13, 2022
eca1e3c
BUG: fix ma.minimum.reduce with axis keyword
rcomer Jul 16, 2022
997d27d
TST: add a test for ma.minimum.reduce with axis keyword
rcomer Jul 16, 2022
bd091a6
MNT: Remove __add__ and other unnecessary overrides
greglucas Jul 23, 2022
b5b9ad3
ENH: Add sign ufunc to masked arrays
greglucas Jul 23, 2022
d0ac064
ENH: Remove masked ufunc power restriction
greglucas Jul 23, 2022
dd74620
ENH: Add masked invert ufunc
greglucas Jul 23, 2022
c638cdc
MNT: Remove some restrictions on masked array ufunc implementations
greglucas Jul 23, 2022
b35c309
FIX: Rearrange handling of ndarray-like ufuncs
greglucas Jul 24, 2022
de22beb
FIX: Pass kwargs through ufunc reduce
greglucas Jul 24, 2022
9564f27
MNT: Add power ufunc to masked arrays
greglucas Jul 24, 2022
a7ba76f
FIX: add back getmaskarray to __array_wrap__ of masked arrays
greglucas Jul 24, 2022
fa6c56f
FIX: view should return the type(self) rather than MaskedArray
greglucas Jul 24, 2022
cbfd86f
FIX: Revert sum and trace overrides from masked arrays
greglucas Jul 24, 2022
4a58583
ENH: Add rint and update round method
greglucas Jul 24, 2022
2acf530
FIX: Change back partition/argpartition
greglucas Jul 24, 2022
e6e80e6
FIX: Remove compress updates
greglucas Jul 24, 2022
366dfc3
MAINT: Remove unused delegate_binop code
greglucas Jan 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
MNT: Remove some restrictions on masked array ufunc implementations
  • Loading branch information
greglucas committed Jan 3, 2023
commit c638cdc005bef2f674ca68206634a0e081bb14f8
7 changes: 5 additions & 2 deletions numpy/ma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3152,9 +3152,12 @@ def __array_ufunc__(self, np_ufunc, method, *inputs, **kwargs):

# Determine what class types we are compatible with and return
# NotImplemented if we don't know how to handle them
for arg in args + outputs:
if not isinstance(arg, (ndarray, np.bool_, Number, list, str)):
for arg in args:
if not isinstance(arg, (ndarray, Number, str)):
return NotImplemented
for arg in outputs:
if not isinstance(arg, ndarray):
raise NotImplemented

# Get the equivalent masked version of the numpy function
# if it is in the module level functions
Expand Down
0