Global variable namespace across embedded cells

29 views
Skip to first unread message

Paul Masson

unread,
Dec 17, 2016, 5:50:46 PM12/17/16
to sage-cell
I'd like to declare a variable containing a data set in one Sage cell, then access it from multiple cells for processing and display. Is there something like a global namespace for the embedding web page? Since this is easily done in notebooks, there should be a way to achieve this with embedded cells. Marking cells as "linked" doesn't work for this because all output ends up in a single output div. 

Thanks!

Rob Beezer

unread,
Dec 17, 2016, 7:10:20 PM12/17/16
to sage...@googlegroups.com
Dear Paul,

Go here:

http://abstract.pugetsound.edu/aata/permute-sage.html

and look at the first three Sage cells - variables from the first two are used
in the third. Is this the behavior you want?

I believe this is using "linked" (check the config on that page), which makes me
think there is something about your question that one of us doesn't understand.

Rob
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to sage-cell+...@googlegroups.com
> <mailto:sage-cell+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/d871bbcc-52b5-4430-acfc-aa97eab8204e%40googlegroups.com
> <https://groups.google.com/d/msgid/sage-cell/d871bbcc-52b5-4430-acfc-aa97eab8204e%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Paul Masson

unread,
Dec 17, 2016, 8:58:14 PM12/17/16
to sage-cell, bee...@ups.edu
Rob, that is the behavior I want and how I expected linking to work, but I would also like the cells to evaluate automatically.

Since that feature is explicitly disabled for linked cells I'm using JavaScript to click all of the evaluation buttons. When that is done all at the same time, the results for the shared kernel do come back in a single output div, so perhaps there is some timing issue that could be fixed. If I delay the clicks for cells dependent on the cell with data, evaluation proceeds as desired.

Thanks for the working example.

Rob Beezer

unread,
Dec 17, 2016, 9:03:45 PM12/17/16
to sage...@googlegroups.com
On 12/17/2016 05:58 PM, Paul Masson wrote:
> Rob, that is the behavior I want and how I expected linking to work, but I would
> also like the cells to evaluate automatically.
>
> Since that feature is explicitly disabled for linked cells

OK, got it. I didn't realize that automatic evaluation of linked cells was
disabled. No more ideas for me to add, but maybe someone else will see how to
do this.
> > to sage-cell+...@googlegroups.com <javascript:>
> > <mailto:sage-cell+...@googlegroups.com <javascript:>>.
> <https://groups.google.com/d/msgid/sage-cell/d871bbcc-52b5-4430-acfc-aa97eab8204e%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cell" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to sage-cell+...@googlegroups.com
> <mailto:sage-cell+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cell/82038d2c-968e-4767-8a44-861853c959b2%40googlegroups.com
> <https://groups.google.com/d/msgid/sage-cell/82038d2c-968e-4767-8a44-861853c959b2%40googlegroups.com?utm_medium=email&utm_source=footer>.

Ingo Dahn

unread,
Jun 8, 2017, 3:04:12 AM6/8/17
to sage-cell
Hi,
I'd like to provide a probably similar worksheet for analyzing data sets. Is there anything available that I may adapt? My worksheet is going to be in German and available under CC-BY-NC..
Reply all
Reply to author
Forward
0 new messages