-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
register IPython's eventloop integration in plt.install_repl_displayhook #6734
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
# trigger IPython's eventloop integration, if available | ||
from IPython.core.pylabtools import backend2gui | ||
|
||
ipython_gui_name = backend2gui.get(get_backend()) |
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.
What does this do with backends that ipython can not map to a name?
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.
Nothing. Since it's a get
from a dict, gui_name will be None and it will take no further action, which can be interpreted as either:
- IPython doesn't know how to integrate with the eventloop for the given backend, or
- it doesn't need to (e.g. Agg)
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.
🐑 right. Thought that backend2gui.get
was something much more complicated.
Closing and reopening to run with miktex changes on appveyor to see if that lets the appveyor tests pass. |
For information, for the moment mpl is quite unusable with IPython 5 when using an interactive session. import matplotlib.pyplot as plt
plt.ion()
fig = plt.figure() I have to use The issue doesn't not occur when I don't use an interactive session, and call |
@afvincent just run |
The windows failure looks tex related. |
@tacaswell : thank you, with the magic command, everything is fine. It seems that I never looked carefully enough to the docs to notice the lines about using |
Seems that the fix in master isn't picked up here :-/ |
registers eventloop integration for IPython on setup, avoiding hangs when IPython hasn't been told about IPython prior to plotting.
7ca197d
to
09e4e62
Compare
pep8 that is definitly not @minrk 's fault, merging as-is. |
MNT: register IPython's eventloop integration in plt.install_repl_displayhook
backported to v2.x as a61f763 |
cherry-picked back to 1.5.x as 44c206b |
MNT: register IPython's eventloop integration in plt.install_repl_displayhook
Registers eventloop integration for IPython on setup, avoiding hangs when IPython hasn't been told about matplotlib prior to plotting.
The IPython kernel (notebook, qtcosole) has always needed this to avoid hangs if plotting happens prior to
%matplotlib
magic, but it was less important for terminal IPython < 5.0. Terminal IPython 5.0's adoption of prompt_toolkit means that it has the same eventloop requirements of the kernel, so it's now important in both contexts to avoid hangs.cc @tacaswell