Re:How to Grow Software Architecture out of Jupyter Notebooks
by GChevalier on Wednesday December 12, 2018 @03:43PM
(#18667578)
Also, you should be able to use your favorite editor for the code outside notebooks (over time, more and more of the code will be outside of your notebook). You might often work in the editor, and at other times in the notebook depending on the nature of the work. As the project advances, notebooks will become less and less important, they only kickstart projects.
Re:How to Grow Software Architecture out of Jupyter Notebooks
by Myrmornis on Wednesday December 12, 2018 @05:09PM
(#18668179)
Thanks. Yes when I'm being organized I manage to get the notebook able to `reload` a module that I'm working on in my editor, which is probably the most important step towards reducing code in the notebook.
But in general I wonder whether this is what I'm looking for: https://github.com/daleroberts/itermplot
See this SO answer: https://stackoverflow.com/a/34583288/2476920
Personally, I love to have notebook cells to be able to code without re-running everything. Especially in the case of deep learning, training a model is long. Jupyter is very good for creating and debugging code that: A) needs a trained model loaded for it to work but you want to skip the part of saving/loading the model, or B) code that saves-then-load a model.
If the "mutable state with global variables" drives you crazy, you may want to avoid reusing the same variable names from one cell to another, and reset the notebook more often. Also, avoid side effects (such as writing/loading from disks) and try to have what's called pure functions (e.g.: avoid singletons or service locators, pass references instead). If your code is clean and does not do too much side effects, you should be able to work fine in notebooks without having headaches.
EDIT: typo.