-
Notifications
You must be signed in to change notification settings - Fork 279
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
BUG: fix crash in image normalization for RGBA image arrays #4094
BUG: fix crash in image normalization for RGBA image arrays #4094
Conversation
if data.ndim == 3: | ||
assert data.shape[-1] == 4 | ||
# this is an RGBA array, only linear normalization makes sense here | ||
norm_type = Normalize |
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.
If it's RGBA then I'm not sure I understand in what cases we'd want normalization. If it's not already scaled 0..1 or 0..255, then we need to apply that manually, and I don't think we want colorbars for that.
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.
indeed, this is just the simplest patch to restore previous behaviour. Before merging #3849 we used to pass a Normalize
object in _init_image, and MPL didn't complain, because it's what it uses by default.
A different approach would be to patch this in _init_image
, though I have a strong preference for leaving this responsability entirely to the NormHandler
class because it's its sole purpose. Does it make sense ? Maybe I can add a little more details in the comment here ?
@yt-fido test this please |
617ab0b
to
7ec78b6
Compare
@yt-fido test this please |
7ec78b6
to
db68135
Compare
@matthewturk if you get the chance, please review this again |
PR Summary
Fix #4093
the bleeding edge CI job is running on my fork at https://github.com/neutrinoceros/yt/actions/runs/2911689231