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
Fix single-shot timers in nbagg backend #4892
Conversation
The single-shot time on UAT 17 runs indefinitely for me |
"text = ax.text(0.5, 0.5, '', ha='center') \n", | ||
"timer = fig.canvas.new_timer(500, [(update, [text], {})])\n", | ||
"\n", | ||
"time.single_shot = True\n", |
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.
should be timer
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.
Woops! I'd fixed that in the notebook I was running but forgot to save it before committing. Thanks for catching that!
@tacaswell - The typo-fix in UAT17 should fix the indefinitely-running problem. I'll verify it tonight when I can test it (at work now). Thanks for catching that! |
FIX: single-shot timers in nbagg backend
@joferkington Thanks! |
Single-shot timers are currently non-functional (raise an error) when using the
nbagg
backed.To reproduce the issue, try running the following in an ipython notebook (I can't seem to find a way to set up a fully independent
nbagg
figure without manually starting a "full" notebook):Ideally, you'd get a figure that would update with a plot 1 second after being displayed. Instead, you'll get an
AttributeError
:Fully fixing this issue is slightly more complex than it seems at first glance. Basically, single-shot timers need to follow a completely different code path than regular timers when using Tornado.
I've added some additional user acceptance tests to
/lib/matplotlib/backends/web_backend/nbagg_uat.ipynb
and can vouch that the current changes don't break any of the manual user acceptance tests in the notebook.