-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: Only send one update signal when autoscaling norms #25079
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
Signal are sent for every vmin/vmax update, when autoscaling we were changing vmin/vmax to None, then updating them which would cause 4 update signals to be sent. We really don't care about the intermediate signals and only want a single one sent after all the udpates are complete.
with self.callbacks.blocked(): | ||
# Pause callbacks while we are updating so we only get | ||
# a single update signal at the end | ||
self.vmin = self.vmax = None | ||
self.autoscale_None(A) |
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.
Maybe just?
with self.callbacks.blocked(): | |
# Pause callbacks while we are updating so we only get | |
# a single update signal at the end | |
self.vmin = self.vmax = None | |
self.autoscale_None(A) | |
if A.size(): | |
self.vmin = A.min() | |
self.vmax = A.max() |
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.
subclasses overwrite autoscale_None()
to handle that themselves, so I think we need to defer to their implementations. I'd save that for another PR if someone wants to tackle it.
I'm still a little grumpy about |
…utoscaling norms
…079-on-v3.7.x Backport PR #25079 on branch v3.7.x (FIX: Only send one update signal when autoscaling norms)
PR Summary
Signal are sent for every vmin/vmax update, when autoscaling we were changing vmin/vmax to None, then updating them which would cause 4 update signals to be sent. We really don't care about the intermediate signals and only want a single one sent after all the updates are complete.
closes #25077
NOTE: The colorbar says "if not norm.scaled(): set vmin/vmax to 0, 1" which doesn't work for the LogNorm scales. Perhaps we should also change that arbitrary 0, 1 expansion. But, this at least makes sure we don't go through the
vmin=None
path here while we are actively updating the norm.PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst