holzschu / Carnets

Carnets is a stand-alone Jupyter notebook server and client. Edit your notebooks on the go, even where there is no network.
https://holzschu.github.io/Carnets_Jupyter/
BSD 3-Clause "New" or "Revised" License
567 stars 33 forks source link

Multiple instances on IpadOS #311

Open BenOnAir opened 1 year ago

BenOnAir commented 1 year ago

Hi!

Since coding usually involves working on multiple files at the same time, I was wondering if there was a way to open multiple instances of Carnets so that you could open multiple jupyter notebooks at the same time on IpadOS. Stage Manager permits that and some apps already have this feature like Safari for example.

Thank you for this wonderful app that saved me for my Data Science Master degree!

holzschu commented 1 year ago

Hi, Carnets has a strong limit: you can only run up to 4 different Python interpreters at the same time. That strongly limits what can be done. I've tried very hard to hide this limit, but it is still present.

Since the Jupyter server is always running and uses one interpreter, and the kernel uses another, that leaves only two extra interpreters. Any call "pip install" will use these two, so I feel that I cannot run multiple instances of Carnets (until I find a way to extend the number of interpreters).

But, the good news is: Carnets also contains Jupyterlab. It's not the default, but it's there. You can switch from "notebook" (the notebook v6 version) to "retrolab" using Settings. Once in "retrolab", you can switch to Jupyterlab (in the TestFlight version, the default settings is "notebooks v7", and you can also switch to Jupyterlab). In Jupyterlab, you can have multiple tabs opened simultaneously, even side by side.

Now, the bad news: there is still a limit to 4 Python interpreters running simultaneously, but it's not enforced in Jupyterlab (so you can have up to 3 tabs opened and running). If you want to run pip in Jupyterlab, you'll have to close all tabs except one.

BenOnAir commented 1 year ago

Thanks for the answer! I'm sure you may have already think about that, but does not having two instances of the app Carnets would fix this issue with the amount of interpreters?

Instance A : 4 interpreters Instance B : 4 interpreters

Regarding JupyterLab, it works great it's really making the software more flexible. However the app don't save my choice to always choose JupyterLab over the classic Notebook, I always have to manually switch to JupyterLab. I don't know if that can be fixed.

Have a nice day!

holzschu commented 1 year ago

For the first question, you can definitely install both Carnets and Carnets-with-scipy, which will give you two instances that can run side by side. That will probably have an impact on your processor and battery usage, though, since that means 4 different Python running simultaneously (two jupyter servers, and two jupyter kernels). But it will work.

For the second question, that's a good question. I need to think about how to do it. It's not a question asked by many people so far, since JupyterLab usage is relatively low, but it's worth doing.