I think that a good approach would be to come up with several use-cases or scenarios of how someone would actually use a hybrid Leo-IPython system. It's no different that the case of Jupyter or sage. I stopped supporting Jupyter notebooks in VR3 for the reason that I couldn't come up with one, at least one that wouldn't take a huge amount of work.In the case of Jupyter notebooks, it's obvious that the input and output blocks could become Leo nodes, and Leo would bring a superior way to work with, view, and and handle those nodes. There are two things that stand in the way: 1) code in each Jupyter input node has access to the variables computed by earlier nodes, and 2) the inline display of graphics. There is also trickiness that about recomputing when the code changes. I can live with the graphics by viewing the notebook with VR3, and I have made fairly extensive notebook-style outlines including code-generated graphics that way. Passing variables from one node to the next would require a serious rethink of how VR3 operates.
Since Jupyter is in some sense an elaborate extension of IPython similar points should apply. I don't know about Sage but it too probably fits into that kind of picture.IPython clients communicate with a server process, isn't that right? I know it's that way with Jupyter. I don't know why there couldn't be a Leo client, but it wouldn't be VR3 (and there is no reason why it should be).
Again, the most important starting point is to think through how a Leo client would work from the user's point of view. Once that is understood, we can come to grips with how to make it work. Trying to make something work before understanding a way or ways to make use of IPython support isn't likely to lead to helpful results, in my view.
I think that a good approach would be to come up with several use-cases or scenarios of how someone would actually use a hybrid Leo-IPython system.
It's no different that the case of Jupyter or sage. I stopped supporting Jupyter notebooks in VR3 for the reason that I couldn't come up with one, at least one that wouldn't take a huge amount of work.
In the case of Jupyter notebooks, it's obvious that the input and output blocks could become Leo nodes, and Leo would bring a superior way to work with, view, and handle those nodes.
There are two things that stand in the way: 1) code in each Jupyter input node has access to the variables computed by earlier nodes, and 2) the inline display of graphics.
There is also trickiness that about recomputing when the code changes. I can live with the graphics by viewing the notebook with VR3, and I have made fairly extensive notebook-style outlines including code-generated graphics that way. Passing variables from one node to the next would require a serious rethink of how VR3 operates.
Since Jupyter is in some sense an elaborate extension of IPython similar points should apply. I don't know about Sage but it too probably fits into that kind of picture.
IPython clients communicate with a server process, isn't that right?
I know it's that way with Jupyter. I don't know why there couldn't be a Leo client
Again, the most important starting point is to think through how a Leo client would work from the user's point of view. Once that is understood, we can come to grips with how to make it work. Trying to make something work before understanding a way or ways to make use of IPython support isn't likely to lead to helpful results, in my view.
Hello Edward & Thomas,Looking forward how this re-design will evolve.
Honestly, it would be great if Leo was used to organize jupyter, but I think this problem is too complicated.
Maintainability may also become a big problem in the future.
I usually synchronize the source code and ipynb through https://github.com/mwouts/jupytext, and then use Leo to organize the source code.
Of course, my whole process seems to be a little troublesome, but in general, the complexity is low, and if there is a problem, it can be easily found.
The thing I like about Jupyter, more than plain iPython notebooks, is that it runs multiple languages -- Julia, R, and Python with seamless integration of input/output and workspace variables between input and output cells. The graphics support in output cells is outstanding. Other languages like bash, yaml, and elixir are also supported -- either natively, or through plugins. In my world there is no single-language solution, and both code and data need version control.
There are two issue that I have with iPython / Jupyter notebooks where Leo can be of immense help:
The notebooks are giant JSON blobs...
Jupyter itself is a horrible code editor...
In my world there is no single-language solution, and both code and data need version control.Summary: I support Leo / JuPyteR integration, whether it is hosted by Jupyter or by Leo.
I'll investigate making Jupyter a client of leoserver only as a last resort.
With jupytext as an inspiration, Leo might pair .ipynb with corresponding outline nodes:- Update the paired outline node when the corresponding .ipynb file changes.- Write the paired .ipynb file when the corresponding outline node changes.The details of pairing .ipynb files with outline nodes are fuzzy. But surely this pairing is possible.I assume that Jupyter can update .ipynb files when they change externally.
.py version of the paired notebook, and get the edits back in Jupyter by selecting reload notebook from disk. The outputs will be reloaded from the .ipynb file, if it exists. The .ipynb version will be updated or recreated the next time you save the notebook in Jupyter. On Monday, October 21, 2024 at 8:54:45 AM UTC-4 Edward K. Ream wrote:I'll investigate making Jupyter a client of leoserver only as a last resort.
I think it should be the other way around.
On Mon, Oct 21, 2024 at 9:14 AM Edward K. Ream wrote:
On Mon, Oct 21, 2024 at 8:44 AM HaveF HaveF wrote:
> HaveF: Also, as far as I know, jupyter is not able to detect external updates, and can only be updated using `reload notebook from disk` in the File menu.> EKR: Hard to believe...From the jupytext FAQ:
There are two issue that I have with iPython / Jupyter notebooks where Leo can be of immense help: