Ask Your Question

Best practice SageMath workflow?

asked 2017-11-02 23:26:12 +0200

Gordon gravatar image

I am using SageMath more and more and finding that my current workflow is not scaling up well, but am not sure how to improve it.

Basically I use the notebook interface on multiple computers (home, work etc), and each worksheet rapidly expands as I interactively test, write, develop, experiment etc.

So I frequently end up searching for functions that I remember writing, but I am not sure which computer they are on, or even what worksheet they are defined in.

I have tried to discipline myself to write functions only in a small number of Dropbox files which I can then load with a single command from any particular machine. But this is rather slow and if I "save and reload" every time I change something then I have lost the main advantage of an interpreted language over the "save and compile" workflow of writing in C.

I have searched the forum and found technical questions on aspects of this problem, such as how to work across multiple machines with a single set of worksheets, but I could not really make the answers (symlinking files to Dropbox, changing environment variables and so on) work.

So my question is: what is an effective "best practice workflow" of using SageMath across multiple machines that combines the benefits of the interpreted environment with the development of a re-usable body of code.

If it matters, I'm working with various flavours of Unix (either Linux or MacOS) but I am really more interested in the big picture of how to organise my own high-level work practices than precise technical details.

(Feel free to describe your own set-up and workflow if it works for you, even if you are unsure whether it qualifies as "best practice")

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-11-03 00:49:19 +0200

mforets gravatar image

updated 2017-11-03 00:52:31 +0200

Hi, i don't know if this qualifies as best practice, but a workflow i've used (to collaborate w/other people) was to put the code in a gitlab repository (which provides ATM free and private hosting, and a very good quality interface), and then to pull it from a CoCalc project. (i don't remember if you need an upgraded account for this; i have one). anyway, the convenience of this approach is that you can work from anywhere with internet and you don't need sagemath installed in all machines..

for the jupyter notebooks/usual scripts concern, i find the former very practical for playing around with a small chunk of code, although it's better to pass to the latter for organizing the code into a usual python module. (i.e. do not pay attention to version controlling the .ipynb file, whose diff is rather messy).

hope that helps!

edit flag offensive delete link more


Absolutely git is the way, or at least some version control software. I personally use github but I don't think that matters much. I think to pull into a CoCalc project, you'll need to use a terminal with internet access and so it won't work on a free plan. But I could be wrong.

Paul Bryan gravatar imagePaul Bryan ( 2017-11-06 09:23:43 +0200 )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

1 follower


Asked: 2017-11-02 23:26:12 +0200

Seen: 487 times

Last updated: Nov 03 '17