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
MRG: First draft of jupyter_compat mode #1394
Conversation
This LGTM! Thank you! |
I've added a I had two worries:
|
Thanks
|
I've added the links to the NEWS entry. For the logic as currently implemented with
Did you look at the Matplotlib figure manager? I have a vague memory that is where you can look for any new but not-yet-displayed figures. |
Thank you!
I have not. I remember having a brief, unsuccessful, look for something like a "pending undisplayed matplotlib plots queue". I'm open to other suggestions for how to to better detect if there is a pending plot, though I think this new approach embodied in this PR seems good. |
Is this necessary? The I'm inclined to keep the current behavior. |
Fair enough - it's certainly niche - although I can imagine a student being surprised they get the output in the Jupyter notebook, and don't see it in the report. |
I asked for advice on detecting new plots over on the Matplotlib discourse .... |
Drop the older method of autoshow, and document the loss of the ability to suppress plots with semicolons.
I've updated the PR with what I think you were suggesting - is it OK? As you've implied, this is a behavior change - as you can now longer suppress plot output with terminating semicolons - but my guess is that this was very rarely used, intentionally. The heuristic for detecting plots will miss this:
but that would need a completely different approach - maybe soneone in the Matplotlib community has an idea. Jupyter has to do this, so it must be possible. |
Also tried asking about plot detection over at Jupyter Discourse. |
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.
LGTM! Thank you!
This is a first attempt to replicate the default Jupyter behavior with
Reticulate.
That is:
See: gh-1391