SageMath Cloud printing all intermediate input

49 views
Skip to first unread message

Michael Yurko

unread,
Apr 7, 2014, 2:36:51 AM4/7/14
to sage-s...@googlegroups.com
I've recently started using sagemath cloud as opposed to a local instance of the notebook. One big difference I've noticed is that in the cloud version, all intermediate output is being printed. However, this is quite annooying when trying to make a plot with matplotlib since writing something like "plt.xlabel('label')" will produce output. Is there a way to suppress this an get the old behavior of the notebook back?

William Stein

unread,
Apr 7, 2014, 12:16:58 PM4/7/14
to sage-support
On Sun, Apr 6, 2014 at 11:36 PM, Michael Yurko <myu...@gmail.com> wrote:
> I've recently started using sagemath cloud as opposed to a local instance of the notebook. One big difference I've noticed is that in the cloud version, all intermediate output is being printed. However, this is quite annooying when trying to make a plot with matplotlib since writing something like "plt.xlabel('label')" will produce output. Is there a way to suppress this an get the old behavior of the notebook back?
>

No there is currently no way to switch to the old sagenb mode. What
happens is that the input is divided into blocks and each is executed
individually with the standard python sys.displayhook behavior.
There are some workarounds, e.g., (1) put your code in a function and
call that function, (2) _ = plt.xlabel('label'), (3) disable
sys.displayhook somehow.

William

> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

kcrisman

unread,
Apr 7, 2014, 12:43:21 PM4/7/14
to sage-s...@googlegroups.com


On Monday, April 7, 2014 12:16:58 PM UTC-4, William wrote:
On Sun, Apr 6, 2014 at 11:36 PM, Michael Yurko <myu...@gmail.com> wrote:
> I've recently started using sagemath cloud as opposed to a local instance of the notebook. One big difference I've noticed is that in the cloud version, all intermediate output is being printed. However, this is quite annooying when trying to make a plot with matplotlib since writing something like "plt.xlabel('label')" will produce output. Is there a way to suppress this an get the old behavior of the notebook back?
>

No there is currently no way to switch to the old sagenb mode.    What
happens is that the input is divided into blocks and each is executed
individually with the standard python sys.displayhook behavior.
There are some workarounds, e.g., (1) put your code in a function and
call that function, (2) _ = plt.xlabel('label'),   (3) disable
sys.displayhook somehow.


How does the IPython notebook handle this situation?  I would imagine the mpl situation would come up fairly frequently. 

Michael Yurko

unread,
Apr 7, 2014, 2:45:10 PM4/7/14
to sage-s...@googlegroups.com
Thanks for the reply. I'll look into the display hook a bit then. I've been using SMC for a few days now and have been very impressed. I guess this is the first "regression" that I have encountered.

William Stein

unread,
Apr 7, 2014, 3:11:13 PM4/7/14
to sage-support support


On Apr 7, 2014 11:45 AM, "Michael Yurko" <myu...@gmail.com> wrote:
>
> Thanks for the reply. I'll look into the display hook a bit then. I've been using SMC for a few days now and have been very impressed. I guess this is the first "regression" that I have encountered.
>

Thanks!! This was an on-purpose design decision though and you're the first to complain about it.  Let me know what happens.  I'm happy to make this functionality configurable, but not today.

Reply all
Reply to author
Forward
0 new messages