ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 03 Jun 2020 22:21:06 +0200From Jupyter to one cell serverhttps://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/ Hi there,
A long time ago I learned how to use the one-cell server. At that moment I was creating simple .html files for my students, so they could execute some code and learn a bit of Sage.
Nowadays this seems inefficient, instead of writing .html file it seems reasonable to write everything in a jupyter notebook. As I want to embed the files into a Moodle page, and want the cells to be executable therein, or by downloading an html file, without having Sage installed in the local machine, I thought I could try to turn each code cell of the jupyter notebook into a cell pointing to the one-cell server. Is it possible to do this efficiently? Can I somehow achieve my goal with Cocalc?
Thanks!Tue, 02 Jun 2020 16:49:21 +0200https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/Answer by Juanjo for <p>Hi there,</p>
<p>A long time ago I learned how to use the one-cell server. At that moment I was creating simple .html files for my students, so they could execute some code and learn a bit of Sage. </p>
<p>Nowadays this seems inefficient, instead of writing .html file it seems reasonable to write everything in a jupyter notebook. As I want to embed the files into a Moodle page, and want the cells to be executable therein, or by downloading an html file, without having Sage installed in the local machine, I thought I could try to turn each code cell of the jupyter notebook into a cell pointing to the one-cell server. Is it possible to do this efficiently? Can I somehow achieve my goal with Cocalc?</p>
<p>Thanks!</p>
https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?answer=51709#post-id-51709This semester I wanted my students to learn and use SageMath. Thanks to the good job of my university computing service, each student had finally access to a virtual machine running a full copy of SageMath 9.0 under the Arch Linux operating system. There are open source virtualization tools (Proxmox in my case) that perhaps could be installed and set up if you ask for it in your institution.
In addition to CoCalc, you could also think about the following options:
* Continue with HTML pages, but, instead of calling SageMath Cell to run the code, use [Thebe and Binder](https://sage-package.readthedocs.io/en/latest/sage_package/thebe.html).
* Write Jupyter notebooks, put them in a Github repository and run them through [mybinder.org](https://mybinder.org/).
This last approach seems quite easy. Inspired by this [repository](https://github.com/sagemath/sage-binder-env) and this [other one](https://github.com/sagemath/more-sagemath-tutorials), I have been able to make executable some of my notebooks. Look, for example, to [this URL](https://mybinder.org/v2/gh/jjtorrens/Cuadricas/master?filepath=Cu%C3%A1dricas.ipynb), which launches in mybinder.org a notebook hosted in this [Github repository](https://github.com/jjtorrens/Cuadricas). This notebook (in Spanish) deals with quadrics. You can evaluate all the cells and see the outputs.
Of course, this last solution has inconveniences. It is slow to start a Jupyter server and there is some delay to get the output for the more intensive computations, such as some 3D graphics. However, I think that this is an option that deserves to be explored and tested.Tue, 02 Jun 2020 20:22:21 +0200https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?answer=51709#post-id-51709Comment by JC for <p>This semester I wanted my students to learn and use SageMath. Thanks to the good job of my university computing service, each student had finally access to a virtual machine running a full copy of SageMath 9.0 under the Arch Linux operating system. There are open source virtualization tools (Proxmox in my case) that perhaps could be installed and set up if you ask for it in your institution.</p>
<p>In addition to CoCalc, you could also think about the following options:</p>
<ul>
<li>Continue with HTML pages, but, instead of calling SageMath Cell to run the code, use <a href="https://sage-package.readthedocs.io/en/latest/sage_package/thebe.html">Thebe and Binder</a>.</li>
<li>Write Jupyter notebooks, put them in a Github repository and run them through <a href="https://mybinder.org/">mybinder.org</a>.</li>
</ul>
<p>This last approach seems quite easy. Inspired by this <a href="https://github.com/sagemath/sage-binder-env">repository</a> and this <a href="https://github.com/sagemath/more-sagemath-tutorials">other one</a>, I have been able to make executable some of my notebooks. Look, for example, to <a href="https://mybinder.org/v2/gh/jjtorrens/Cuadricas/master?filepath=Cu%C3%A1dricas.ipynb">this URL</a>, which launches in <a href="http://mybinder.org">mybinder.org</a> a notebook hosted in this <a href="https://github.com/jjtorrens/Cuadricas">Github repository</a>. This notebook (in Spanish) deals with quadrics. You can evaluate all the cells and see the outputs. </p>
<p>Of course, this last solution has inconveniences. It is slow to start a Jupyter server and there is some delay to get the output for the more intensive computations, such as some 3D graphics. However, I think that this is an option that deserves to be explored and tested.</p>
https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?comment=51710#post-id-51710Thanks for taking the time. I am aware of Binder and the like, but it is not what I want : the goal would be to have everything running with one click, without leaving Moodle, without having to rely on the local machine, nor an external server (we actually may have a jupyter hub server working).
The question is more like : is there a way to quickly turn a code cell into a cell to be interpreted by the one-cell server? Thanks!Tue, 02 Jun 2020 21:16:00 +0200https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?comment=51710#post-id-51710Comment by Juanjo for <p>This semester I wanted my students to learn and use SageMath. Thanks to the good job of my university computing service, each student had finally access to a virtual machine running a full copy of SageMath 9.0 under the Arch Linux operating system. There are open source virtualization tools (Proxmox in my case) that perhaps could be installed and set up if you ask for it in your institution.</p>
<p>In addition to CoCalc, you could also think about the following options:</p>
<ul>
<li>Continue with HTML pages, but, instead of calling SageMath Cell to run the code, use <a href="https://sage-package.readthedocs.io/en/latest/sage_package/thebe.html">Thebe and Binder</a>.</li>
<li>Write Jupyter notebooks, put them in a Github repository and run them through <a href="https://mybinder.org/">mybinder.org</a>.</li>
</ul>
<p>This last approach seems quite easy. Inspired by this <a href="https://github.com/sagemath/sage-binder-env">repository</a> and this <a href="https://github.com/sagemath/more-sagemath-tutorials">other one</a>, I have been able to make executable some of my notebooks. Look, for example, to <a href="https://mybinder.org/v2/gh/jjtorrens/Cuadricas/master?filepath=Cu%C3%A1dricas.ipynb">this URL</a>, which launches in <a href="http://mybinder.org">mybinder.org</a> a notebook hosted in this <a href="https://github.com/jjtorrens/Cuadricas">Github repository</a>. This notebook (in Spanish) deals with quadrics. You can evaluate all the cells and see the outputs. </p>
<p>Of course, this last solution has inconveniences. It is slow to start a Jupyter server and there is some delay to get the output for the more intensive computations, such as some 3D graphics. However, I think that this is an option that deserves to be explored and tested.</p>
https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?comment=51716#post-id-51716If such a way exists, I don't know it. Sorry.Wed, 03 Jun 2020 01:27:24 +0200https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?comment=51716#post-id-51716Answer by Emmanuel Charpentier for <p>Hi there,</p>
<p>A long time ago I learned how to use the one-cell server. At that moment I was creating simple .html files for my students, so they could execute some code and learn a bit of Sage. </p>
<p>Nowadays this seems inefficient, instead of writing .html file it seems reasonable to write everything in a jupyter notebook. As I want to embed the files into a Moodle page, and want the cells to be executable therein, or by downloading an html file, without having Sage installed in the local machine, I thought I could try to turn each code cell of the jupyter notebook into a cell pointing to the one-cell server. Is it possible to do this efficiently? Can I somehow achieve my goal with Cocalc?</p>
<p>Thanks!</p>
https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?answer=51736#post-id-51736Alternative : have a look at [PreTeXT](https://pretextbook.org/), recently presented at the latest Sage Days. I haven't explored this, but the presentation was impressive.
One caveat : it seems that you'll have to pound your document in XML somehow...
HTH,
Wed, 03 Jun 2020 20:11:44 +0200https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?answer=51736#post-id-51736Comment by JC for <p>Alternative : have a look at <a href="https://pretextbook.org/">PreTeXT</a>, recently presented at the latest Sage Days. I haven't explored this, but the presentation was impressive.</p>
<p>One caveat : it seems that you'll have to pound your document in XML somehow...</p>
<p>HTH,</p>
https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?comment=51743#post-id-51743Thanks Emmanuel, I played around a with PreTeXT a little bit, and from what I understand, it is more complex, although in principle feasible. But then again : in principle that should not be very hard to write a script that takes as input one .html produced by jupyter and turn avery cell code into a celle that is to be interpreted by a one-cell server.Wed, 03 Jun 2020 22:21:06 +0200https://ask.sagemath.org/question/51705/from-jupyter-to-one-cell-server/?comment=51743#post-id-51743