| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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.
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() |
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
|
I'm still a little grumpy about norm.vmin = None triggering a callback - it is certainly a case where I think an explicit setter is more clear than properties because you think to look for what set_vmin does rather than just expect it to assign a value, not also do a bunch of other things... But, this fix should go in ASAP, either my suggestion or the original is fine. |
Sorry, something went wrong.
…utoscaling norms
…079-on-v3.7.x Backport PR #25079 on branch v3.7.x (FIX: Only send one update signal when autoscaling norms)
| Back | FazBrowse Home | New Git URL |
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
Release Notes