Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
ENH: Add the ability to block callback signals#20816
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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.
I think this could be really useful for debugging interactive stuff, so tentatively 👍
Uh oh!
There was an error while loading.Please reload this page.
a9680e7
toad95b35
CompareThere 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.
minor nits, but liking the new docs :)
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
What do you think about naming this |
@timhoffm, apparently there is a preferred convention and your suggestion lines up with that :) |
story645 commentedAug 11, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Also, and I might be confused about the functionality here, but would it be possible for the what's new example to be slight less toy/use like one of the auto registrated callbacks or something? |
CallbackRegistry objects now have a context manager .block()method that can be used to temporarily block callback signalsfrom being processed.
I came up with another toy-like example, but with interactivity on the figure canvas and disabling key-press events. Did you have another example/area in mind to apply this? It looks like the widgets keep their callbacks private in |
Using fig.canvas.callbacks is perfect - I was unsure whether the functionality extended to the fig callbacks and this clears it right up & I think would be a common use case 😄 |
PR Summary
CallbackRegistry objects gain a context manager
.block()
method that can be used to temporarily block callback signals from being processed.Closes#20802
Would help with disabling norm update signals in#19553
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).