Split view + sort cells based on dependency #528
Replies: 8 comments
-
Thank you for the fun suggestion! It is a very big change of course, so let me suggest two (future) alternatives: Same notebookYou can open the same Pluto notebooks in multiple browser windows, and they will all be synchronized while you work on either one. If you 'split' your notebook into two sections using a header, you can open your functions (at the bottom) in one window, and your short cells in another. Since a few days ago ( Maybe this is something that you can try out? Multiple notebooksUsing The point of both of these suggestions is: browser windows already allow the visual setup that you suggested, so a simpler approach would be to build on top of that. What do you think? |
Beta Was this translation helpful? Give feedback.
-
I'm not a fan of the sorting feature, I am a fan of unsorted notebooks: #270 (comment) |
Beta Was this translation helpful? Give feedback.
-
Just tried this out, very cool! Definitely goes a long way towards addressing the use cases I mention, although juggling multiple browser windows feels a little kludgey. I guess in some cases the OS/window manager might help out there (e.g. split view on MacOS). I'll try working this way for a bit and see how it goes. For discoverability, maybe a button that opens a second instance (tab/window) of the same page would be helpful. An additional option in the "export" menu? I definitely like what you're getting at with At the risk of dragging things OT but it's a bit related: I really like the simplicity of likening a Pluto notebook to a spreadsheet--taking that a little farther would lead to something like spreadsheet tabs, i.e. regions of the same scope that go in and out of visibility, to allow better organization. Maybe a better metaphor would be sections rather than tabs but the idea would be the same. Is that something you've considered?
I'm also a fan of the ability to have "unsorted" notebooks! Or maybe more accurately the ability to sort the notebook as you see fit, which in some cases means at least a subset of the cells being ordered based on dependency. To that end I do think there is something to be said for there being an indication of the data flow in certain cases, even if there isn't any automatic sorting available. Besides the use case of making the notebook easier to understand there's also debugging; again going back to the analogy to spreadsheets--Excel has trace precedents/dependents commands to help with the same problem that occurs with complex spreadsheets. |
Beta Was this translation helpful? Give feedback.
-
BTW I just noticed that "Submit All Changes" in one window doesn't submit changes in cells from the other window. |
Beta Was this translation helpful? Give feedback.
-
It would be good to provide an |
Beta Was this translation helpful? Give feedback.
-
I don't like this idea, but maybe you can say more about what you are trying to debug? Would #304 help? |
Beta Was this translation helpful? Give feedback.
-
I am debugging a long notebook containing different sections (the loss, the optimizer, the initial parameter and finally training.), I move sections up and down quite often and accidentally break the dependency of variables, but the notebook does not error immediately. I hope it error because, mutating the variable later will make the result unpredictable. Moreover, I suspect the issue of multiple execution with flashing error message (can describe in detail to you later) is related to the execution order. Because if Pluto executes the cells from top to bottom, there should not be any multiple execution. #304 will solve part of the issue. |
Beta Was this translation helpful? Give feedback.
-
I believe I did something similar with JupyterLab for one Python project. In JupyterLab you can open two notebooks that have the same kernel. I had "support cells" in the second notebook while the main functionality was in the first notebook. It worked, but every time I restarted JupyterLab, I had to manually switch them to use the same kernel, which was slightly awkward. So the suggestion would be to simply have two notebooks with the same kernel. An extension would be to have a visual DAG-view of Pluto notebooks working on the same kernel / together. If you have code executing in any order, it doesn't seem necessary to have code in a single top-down document, it can be split to multiple ones. |
Beta Was this translation helpful? Give feedback.
-
(Disclaimer: I've only been using Pluto for a little while now, and largely on toy problems/coding challenge type use cases so take the below with that context in mind. 😀)
tl;dr add 2 related features:
Background:
I've noticed a couple of relevant patterns that suggest some possible features:
Firstly my cells seem to come in 2 flavors:
So the first kind basically is the classic notebook in a linear "narrative" as one usually tries to do with Jupyter and the second is "supplementary"/"supporting" in a sense. Also, I find that often the second flavor starts off as the first, usually as a pattern emerges and DRY is applied. During this process there's a certain amount of jumping between function definition and caller, which especially without (yet?) a jump-to-definition feature is a bit of an unpleasant experience compared to a typical editor.
I think there could also be an educational benefit of a kind: By introducing the sorting feature early in documentation/making it very discoverable, the reactive nature of Pluto will be emphasized and the visual difference can help differentiate from Jupyter.
Of course this idea could be generalized to have more than 2 panes, to have dockable cells, etc. but I think what I'm suggesting is probably the MVP.
Note that #13 also relates to helping the user have a better mental model of dependencies and these suggestions wouldn't be a replacement, but rather complementary.
Beta Was this translation helpful? Give feedback.
All reactions