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, 24 Feb 2021 09:19:40 +0100alternative to jupyter notebook?https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/ I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!Tue, 23 Feb 2021 06:11:34 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/Comment by Ingrid for <p>I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55857#post-id-55857Thanks, saving does help. I have no understanding of this process; why most of my stuff can be saved individually but is not saved when I save the session, or the ipynb file. For the moment, as long as it works.
I've started on a newer computer, with more RAM, which also helps with some of the issues.
Learning Linux will have to wait until we get IT support :-)Wed, 24 Feb 2021 03:15:27 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55857#post-id-55857Comment by Emmanuel Charpentier for <p>I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55828#post-id-55828Basically, your problem seems not to be Jupyter *per se*, but the size of your problem's computation.
> When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file.
You may have hit a (new ?) bug. Further exploration may be in order.
> Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again.
Correct. You should explicitly `save` the computed objects, and `load` them when needed. See also `save_session`, but *take note of its limits*...
'rburning`'s suggestion to split your work by saving each part's results as needed is sound. BTW, your husband's is also sound, and might reap benefits unrelated to Sagemath ;-)...Tue, 23 Feb 2021 10:21:50 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55828#post-id-55828Comment by rburing for <p>I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55825#post-id-55825At least as a workaround you can [save and load](https://doc.sagemath.org/html/en/reference/misc/sage/misc/persist.html#sage.misc.persist.save) intermediate results (see the examples there).Tue, 23 Feb 2021 09:52:31 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55825#post-id-55825Comment by Sébastien for <p>I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55826#post-id-55826You may also [save/load the whole session](https://doc.sagemath.org/html/en/reference/misc/sage/misc/session.html):
save_session('first_computations.sobj')
Then, in another notebook:
load_session('first_computations.sobj')Tue, 23 Feb 2021 09:59:59 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55826#post-id-55826Comment by Sébastien for <p>I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55866#post-id-55866It is a good question. When you "save" a Jupyter notebook, you save the string representation of the inputs and the string representation of the outputs, but not the input themselves or the output themselves, nor the global variables. For example, you can see that the lists `In` and `Out` (which contains all inputs and all outputs when you save) are empty when you close and open the notebook again : it starts at 1 again with `In[1]` and `Out[1]`. By using `save_session('a.sobj')` and `load_session('a.sobj')` you reload all variables in the namespace including the `In` and `Out` lists.Wed, 24 Feb 2021 09:19:40 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55866#post-id-55866Answer by Sébastien for <p>I have a number of problems using Jupyter notebook, windows 10.
When my .ipynb file reaches a certain length, sage basically grinds to a halt, and I need to start a new file. When doing a long calculation, where each bit needs the calculations from the previous part, this isn't practical. Also, when I "save" an .ipynb file, the actual calculations aren't saved, and each file takes about half a day to go through and recalculate everything again. I have about 5 files now, and the power keeps flickering on and off briefly...
Also, it happens constantly that sage won't let me type anything in. This can last for up to 10 minutes at a time, and seems to have something to do with the way the file is saved.
I haven't even reached the final part of my calculation, which is the part I expect to be the slowest by far.
My husband tells me to stop messing around with windows and learn Linux. Any other suggestions?
Thanks very much!</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?answer=55827#post-id-55827I enjoy the Jupyter notebook when lot of plots are in my outputs. But, remember that interactive computations can be done in the console as well. Also when code becomes large with hundred if not thousands of line of codes, a basic text file edited with a text editor is sometimes more efficient than a Jupyter cell.
Did you try jupyterlab? I allows to open a text file like `file.sage` or `file.py` on one side and a sage console in the other side. Then, you can call `%runfile file.sage` in the console or even better `%attach file.sage` which automatically reloads the file when it changes.
You may install jupyterlab on Sage in Windows as explained in this [other ask question](https://ask.sagemath.org/question/55680/installing-and-running-jupyterlab-for-sagemath-in-windows/).
Tue, 23 Feb 2021 10:10:25 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?answer=55827#post-id-55827Comment by Ingrid for <p>I enjoy the Jupyter notebook when lot of plots are in my outputs. But, remember that interactive computations can be done in the console as well. Also when code becomes large with hundred if not thousands of line of codes, a basic text file edited with a text editor is sometimes more efficient than a Jupyter cell.</p>
<p>Did you try jupyterlab? I allows to open a text file like <code>file.sage</code> or <code>file.py</code> on one side and a sage console in the other side. Then, you can call <code>%runfile file.sage</code> in the console or even better <code>%attach file.sage</code> which automatically reloads the file when it changes.</p>
<p>You may install jupyterlab on Sage in Windows as explained in this <a href="https://ask.sagemath.org/question/55680/installing-and-running-jupyterlab-for-sagemath-in-windows/">other ask question</a>.</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55858#post-id-55858I haven't got jupyterlab working yet, but yes, I do have thousands of lines. If everything works out, I will want to put the results into a .tex file Long term this definitely sounds like what I need. Thanks.Wed, 24 Feb 2021 03:41:48 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55858#post-id-55858Comment by Sébastien for <p>I enjoy the Jupyter notebook when lot of plots are in my outputs. But, remember that interactive computations can be done in the console as well. Also when code becomes large with hundred if not thousands of line of codes, a basic text file edited with a text editor is sometimes more efficient than a Jupyter cell.</p>
<p>Did you try jupyterlab? I allows to open a text file like <code>file.sage</code> or <code>file.py</code> on one side and a sage console in the other side. Then, you can call <code>%runfile file.sage</code> in the console or even better <code>%attach file.sage</code> which automatically reloads the file when it changes.</p>
<p>You may install jupyterlab on Sage in Windows as explained in this <a href="https://ask.sagemath.org/question/55680/installing-and-running-jupyterlab-for-sagemath-in-windows/">other ask question</a>.</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55864#post-id-55864.tex file is for LaTeX. I guess you mean .py or .sage ? If you have thousands of lines of code, I strongly suggest to put that in a file called let's say `file.sage` and then simply do `%runfile file.sage` in the first cell of a Jupyter notebook or in the Sage console.Wed, 24 Feb 2021 09:11:08 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55864#post-id-55864Comment by Emmanuel Charpentier for <p>I enjoy the Jupyter notebook when lot of plots are in my outputs. But, remember that interactive computations can be done in the console as well. Also when code becomes large with hundred if not thousands of line of codes, a basic text file edited with a text editor is sometimes more efficient than a Jupyter cell.</p>
<p>Did you try jupyterlab? I allows to open a text file like <code>file.sage</code> or <code>file.py</code> on one side and a sage console in the other side. Then, you can call <code>%runfile file.sage</code> in the console or even better <code>%attach file.sage</code> which automatically reloads the file when it changes.</p>
<p>You may install jupyterlab on Sage in Windows as explained in this <a href="https://ask.sagemath.org/question/55680/installing-and-running-jupyterlab-for-sagemath-in-windows/">other ask question</a>.</p>
https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55839#post-id-55839To *complement* `Sebastien`'s suggestion, may I point to the [sage-shell](https://github.com/sagemath/sage-shell-mode) package that adds sage-related features to [emacs](https://www.gnu.org/software/emacs/), including a quite powerful `inferior-sage` to (one or many) "live" Sage session(s), in parallel with the extremely powerful editing abilities of `emacs`.
IMNSHO, this is the best IDE currently available for Sagemath. However, `emacs` is not in everyone's taste. If you use a computer for anything even vaguely related to programming, you should try to learn it (at least to see if it suits your taste).
This is even more true if you plan to create documents mixing text and "live" code ([reproducible reports](https://en.wikipedia.org/wiki/Reproducibility#Reproducible_research)).Tue, 23 Feb 2021 17:43:36 +0100https://ask.sagemath.org/question/55818/alternative-to-jupyter-notebook/?comment=55839#post-id-55839