Skip to content
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

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Commits on Jan 3, 2023

  1. 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.
    greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    ab732d0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    63df460 View commit details
    Browse the repository at this point in the history
  3. nomask in nomask out

    rcomer authored and greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    a63e97a View commit details
    Browse the repository at this point in the history
  4. 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.
    rcomer authored and greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    eca1e3c View commit details
    Browse the repository at this point in the history
  5. TST: add a test for ma.minimum.reduce with axis keyword

    Adapted from the problem reported at
    numpy#21977 (comment)
    rcomer authored and greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    997d27d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bd091a6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b5b9ad3 View commit details
    Browse the repository at this point in the history
  8. 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.
    greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    d0ac064 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    dd74620 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c638cdc View commit details
    Browse the repository at this point in the history
  11. 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__
    greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    b35c309 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    de22beb View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    9564f27 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a7ba76f View commit details
    Browse the repository at this point in the history
  15. FIX: view should return the type(self) rather than MaskedArray

    This allows for subclasses to be handled correctly
    greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    fa6c56f View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    cbfd86f View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    4a58583 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    2acf530 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    e6e80e6 View commit details
    Browse the repository at this point in the history
  20. MAINT: Remove unused delegate_binop code

    This is handled in the C code now within the ufunc machinery.
    greglucas committed Jan 3, 2023
    Configuration menu
    Copy the full SHA
    366dfc3 View commit details
    Browse the repository at this point in the history