-
-
Notifications
You must be signed in to change notification settings - Fork 557
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 _repr_ of graphics objects #14469
Comments
This comment has been minimized.
This comment has been minimized.
Dependencies: #14203 |
Author: Volker Braun |
comment:5
I've totally done something analogous to I don't have time to learn about displayhook now, but the rest looks good, assuming it works properly in the notebook. Unless... you don't suppose someone would actually want to be able to change the default behavior of (say) |
comment:6
The IMHO only remaining problem is that the patch triggers what looks like a Python bug, see #14471. |
comment:7
Two things on the current patch:
Also I think if someone wants |
comment:8
Rebased for |
comment:10
Changed patch to not catch any exceptions that might have come from generating the plot |
comment:11
Just a heads up -- it is failing some doctests according to the patchbot. |
Updated patch |
comment:12
Attachment: trac_14469_repr_graphics.patch.gz Should be fixed now. |
Reviewer: Travis Scrimshaw |
comment:13
Looks good to me. |
comment:15
This requires a version of the notebook that includes the commit vbraun/sagenb@89c6b6c. I've tentatively made a ticket for the upgrade to have something to put into the dependency fied. |
comment:17
Fixed with the sagenb spkg from #15016 |
Merged: sage-5.12.beta1 |
comment:19
Followup at #15066 |
comment:20
I am not sure if this is the reason, but in a server-worker setup graphics is not shown in 5.12.beta4, while it does in 5.11 + sagenb-0.10.7.1. |
comment:21
Made a ticket #15168 for this. |
Graphical output of plots (or other graphics objects) is hooked into
_repr_()
. Obviously, Python doesn't expectrepr
to have side effects so we get fun stuff likeshowing a plot in addition to the help. Or
(g,g)
opening two plot output windows if used on the command line. You don't want to try[g]*100
This patch moves the decision logic into the displayhook, and makes
repr
always return a string representation as it should.Also, deprecate the
show_output()
function. Wat?Depends on #14203
Depends on #14266
Depends on #14471
Depends on #15016
CC: @ppurka
Component: graphics
Author: Volker Braun
Reviewer: Travis Scrimshaw
Merged: sage-5.12.beta1
Issue created by migration from https://trac.sagemath.org/ticket/14469
The text was updated successfully, but these errors were encountered: