ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 03 Nov 2015 14:19:36 -0600Publishing a worksheet that uses moduleshttps://ask.sagemath.org/question/30377/publishing-a-worksheet-that-uses-modules/ 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?
Sat, 31 Oct 2015 14:01:35 -0500https://ask.sagemath.org/question/30377/publishing-a-worksheet-that-uses-modules/Answer by slelievre for <p>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:</p>
<pre><code>load ("/home/erelsgl/git/myproject/ClassA.sage")
... Do some things with class A ...
</code></pre>
<p>The file ClassA.sage looks like this:</p>
<pre><code>load ("/home/erelsgl/git/myproject/ClassB.sage")
... Define class A based on class B ...
</code></pre>
<p>This works on my computer, but of course it will not work when I publish it on the cloud.</p>
<p>What is the correct way to write my notebook and its modules such that it will be publishable in the Sage cloud?</p>
https://ask.sagemath.org/question/30377/publishing-a-worksheet-that-uses-modules/?answer=30388#post-id-30388On 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")Sun, 01 Nov 2015 10:59:31 -0600https://ask.sagemath.org/question/30377/publishing-a-worksheet-that-uses-modules/?answer=30388#post-id-30388Comment by Erel Segal-Halevi for <p>On SageMathCloud at <a href="http://cloud.sagemath.com">cloud.sagemath.com</a>, you can make a whole directory public.</p>
<p>That directory can include your .sage files and the .sagews or .ipynb worksheet.</p>
<p>In the .sagews or .ipynb worksheet, just use relative paths for loading.</p>
<pre><code>load("ClassB.sage")
</code></pre>
https://ask.sagemath.org/question/30377/publishing-a-worksheet-that-uses-modules/?comment=30433#post-id-30433This works. Thanks!Tue, 03 Nov 2015 14:19:36 -0600https://ask.sagemath.org/question/30377/publishing-a-worksheet-that-uses-modules/?comment=30433#post-id-30433