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
Hide whitespace
Diff view
Prev Previous commit
Next Next commit
FIX: add back getmaskarray to __array_wrap__ of masked arrays
  • Loading branch information
greglucas committed Jan 3, 2023
commit a7ba76fb9c8b51c26fa8052ee35f1beccb6f39c1
3 changes: 2 additions & 1 deletion numpy/ma/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3096,7 +3096,7 @@ def __array_wrap__(self, obj, context=None):
func, args, out_i = context
# args sometimes contains outputs (gh-10459), which we don't want
input_args = args[:func.nin]
m = reduce(mask_or, [getmask(arg) for arg in input_args])
m = reduce(mask_or, [getmaskarray(arg) for arg in input_args])
# Get the domain mask
domain = ufunc_domain.get(func, None)
if domain is not None:
Expand Down Expand Up @@ -3124,6 +3124,7 @@ def __array_wrap__(self, obj, context=None):
else:
# Don't modify inplace, we risk back-propagation
m = (m | d)

# Make sure the mask has the proper size
if result is not self and result.shape == () and m:
return masked
Expand Down
0