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: Implement correct scalar and integer overflow errors for NEP 50 #21875

Merged
merged 13 commits into from
Oct 18, 2022

Commits on Oct 12, 2022

  1. ENH: Implement safe integers and weak python scalars for scalars

    This requires adding a path that uses the "normal" Python object
    to dtype conversion (setitem) function, rather than always converting
    to the default dtype.
    seberg committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    409cccf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d894650 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0a0f96f View commit details
    Browse the repository at this point in the history
  4. MAINT: Use Python integers for int to array of uint32 calculation

    The new weak promotion preserves the original type, this makes the
    `//= 2**32` fail for certain inputs.  The alternative would be
    typing that as `np.int64(2**32)`, but using Python integers seems
    easier and cleaner.
    
    The code was effectively OK before, since the inputs were guaranteed
    signed (or Python integers) at that point and 2**32 would have been
    considered like a NumPy `int64`.  (Which would be an alternative fix.)
    seberg committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    89cfcf0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2143cca View commit details
    Browse the repository at this point in the history
  6. BUG: Ensure new-style promotion is not accidentally used for some ints

    This is the *actual* correct fix for the test adaptations.  The test
    adaptations should only be necessary when running in weak-promotion mode,
    but they are NOT doing that currently.
    seberg committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    fed11cd View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d47b09c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c4f1419 View commit details
    Browse the repository at this point in the history
  9. TST: Avoid possible warning from unnecessary cast with uninitialized …

    …values
    
    This should be fixed in `choose` to not do the unnecessary cast,
    see numpygh-22237.
    seberg committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    d53a2b6 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    0375d16 View commit details
    Browse the repository at this point in the history
  11. TST: Cover additional NEP 50 scalar paths

    Especially adding coverage also for the power operator which
    does not share its code perfectly.
    seberg committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    4ecc035 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d9da02d View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ee3c20b View commit details
    Browse the repository at this point in the history