-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
ENH: Adding __array_ufunc__ capability to MaskedArrays (again) #22914
base: main
Are you sure you want to change the base?
Commits on Jan 3, 2023
-
ENH: Adding __array_ufunc__ capability to MaskedArrays.
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.
Configuration menu - View commit details
-
Copy full SHA for ab732d0 - Browse repository at this point
Copy the full SHA ab732d0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 63df460 - Browse repository at this point
Copy the full SHA 63df460View commit details -
Configuration menu - View commit details
-
Copy full SHA for a63e97a - Browse repository at this point
Copy the full SHA a63e97aView commit details -
BUG: fix ma.minimum.reduce with axis keyword
Fixes the problem reported at numpy#21977 (comment) The reduce method here effectively calls itself with an unmasked MaskedArray (mask=nomask) and then expects either a MaskedArray or a scalar. This change ensures that an ordinary ndarray is converted to a MaskedArray, following the pattern already used in mean and var in this module.
Configuration menu - View commit details
-
Copy full SHA for eca1e3c - Browse repository at this point
Copy the full SHA eca1e3cView commit details -
TST: add a test for ma.minimum.reduce with axis keyword
Adapted from the problem reported at numpy#21977 (comment)
Configuration menu - View commit details
-
Copy full SHA for 997d27d - Browse repository at this point
Copy the full SHA 997d27dView commit details -
Configuration menu - View commit details
-
Copy full SHA for bd091a6 - Browse repository at this point
Copy the full SHA bd091a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5b9ad3 - Browse repository at this point
Copy the full SHA b5b9ad3View commit details -
ENH: Remove masked ufunc power restriction
Now we are calling np.power() in std() which goes through the ufunc machinery, so we don't want to pass any additional unsafe casting kwargs that aren't allowed within the masked implementation.
Configuration menu - View commit details
-
Copy full SHA for d0ac064 - Browse repository at this point
Copy the full SHA d0ac064View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd74620 - Browse repository at this point
Copy the full SHA dd74620View commit details -
Configuration menu - View commit details
-
Copy full SHA for c638cdc - Browse repository at this point
Copy the full SHA c638cdcView commit details -
FIX: Rearrange handling of ndarray-like ufuncs
Move the np-ufunc check to the top of the routine so we immediately go to super() when necessary. Before we were returning NotImplemented if an arg wasn't able to be handled. Update the arg instance check to defer for everything but another class that has implemented __array_ufunc__
Configuration menu - View commit details
-
Copy full SHA for b35c309 - Browse repository at this point
Copy the full SHA b35c309View commit details -
Configuration menu - View commit details
-
Copy full SHA for de22beb - Browse repository at this point
Copy the full SHA de22bebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9564f27 - Browse repository at this point
Copy the full SHA 9564f27View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7ba76f - Browse repository at this point
Copy the full SHA a7ba76fView commit details -
FIX: view should return the type(self) rather than MaskedArray
This allows for subclasses to be handled correctly
Configuration menu - View commit details
-
Copy full SHA for fa6c56f - Browse repository at this point
Copy the full SHA fa6c56fView commit details -
Configuration menu - View commit details
-
Copy full SHA for cbfd86f - Browse repository at this point
Copy the full SHA cbfd86fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a58583 - Browse repository at this point
Copy the full SHA 4a58583View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2acf530 - Browse repository at this point
Copy the full SHA 2acf530View commit details -
Configuration menu - View commit details
-
Copy full SHA for e6e80e6 - Browse repository at this point
Copy the full SHA e6e80e6View commit details -
MAINT: Remove unused delegate_binop code
This is handled in the C code now within the ufunc machinery.
Configuration menu - View commit details
-
Copy full SHA for 366dfc3 - Browse repository at this point
Copy the full SHA 366dfc3View commit details