Fix imshow to work with subclasses of ndarray. #18286
Fix imshow to work with subclasses of ndarray. #18286dstansby merged 3 commits intomatplotlib:masterfrom l-johnston:issue_18077
Conversation
jklymak
left a comment
There was a problem hiding this comment.
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? |
dopplershift
left a comment
There was a problem hiding this comment.
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