-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix imshow to work with subclasses of ndarray. #18286
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems right - OTOH do you have a test?
I took a look at matplotlib's |
(Please don't put the issue in title, but yes, please do put issue in description!) |
I might be able to implement a skeleton ndarray subclass with just enough features to reproduce the bug and then test the fix. Is this of interest? |
|
@dopplershift I implemented the skeleton ndarray subclass that reproduces the bug and validates the fix. Is this sufficient? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems fine to me.
There is a slight question as to whether this should go into test_units.py
(see #18278), but I'm not holding this up for that.
Thoughts on backporting to 3.3.x as a bugfix? |
Thanks for fixing this ! |
PR Summary
Closes #18077
In the internals of _ImageBase._make_image, the clip bounds arithmetic fails with ndarray subclasses that support masked arrays such as
unyt
.PR Checklist