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

TST: Update Quantity test class #23523

Merged
merged 2 commits into from Jul 31, 2022
Merged

Conversation

greglucas
Copy link
Contributor

PR Summary

  1. The class should return NotImplemented rather than raise NotImplementedError: https://numpy.org/devdocs/user/basics.subclassing.html#array-ufunc-for-ufuncs

  2. Allow unitless comparison operators to pass-through

Closes #23382

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).

__array_ufunc__ should "return" rather than "raise" when something
is not handled within it.
@tacaswell tacaswell added this to the v3.5.3 milestone Jul 30, 2022
@tacaswell
Copy link
Member

I am a bit worried that coverage does not see this change, however I can confirm that this fixes a failing test for me locally.

@tacaswell
Copy link
Member

What fails on main:

FAILED lib/matplotlib/tests/test_image.py::test_imshow_quantitynd - NotImplementedError

@jklymak jklymak merged commit fa58d55 into matplotlib:main Jul 31, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 31, 2022
timhoffm added a commit that referenced this pull request Jul 31, 2022
…523-on-v3.5.x

Backport PR #23523 on branch v3.5.x (TST: Update Quantity test class)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TST] Upcoming dependency test failures
3 participants