Ask Your Question
1

Publishing a worksheet that uses modules

asked 2015-10-31 20:01:35 +0100

Erel Segal-Halevi gravatar image

updated 2016-06-06 21:44:55 +0100

FrédéricC gravatar image

I wrote a worksheet in the Sage Notebook. Since it was large, I split it into several modules. So now my worksheet looks like this:

load ("/home/erelsgl/git/myproject/ClassA.sage")

... Do some things with class A ...

The file ClassA.sage looks like this:

load ("/home/erelsgl/git/myproject/ClassB.sage")

... Define class A based on class B ...

This works on my computer, but of course it will not work when I publish it on the cloud.

What is the correct way to write my notebook and its modules such that it will be publishable in the Sage cloud?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2015-11-01 17:59:31 +0100

slelievre gravatar image

updated 2015-11-02 15:18:38 +0100

On SageMathCloud at cloud.sagemath.com, you can make a whole directory public.

That directory can include your .sage files and the .sagews or .ipynb worksheet.

In the .sagews or .ipynb worksheet, just use relative paths for loading.

load("ClassB.sage")
edit flag offensive delete link more

Comments

This works. Thanks!

Erel Segal-Halevi gravatar imageErel Segal-Halevi ( 2015-11-03 21:19:36 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-10-31 20:01:35 +0100

Seen: 403 times

Last updated: Nov 02 '15