News for hackers. Stuff that matters.
Re:Making Git and Jupyter Notebooks play nice by morotter on Friday November 29, 2019 @12:55AM (#21662373)
I found a good compromise by using VSCode Python extension. You can import Jupyter notebooks as Python scripts and the other way around [0]. If I need to work on a notebook, I prefer working with a Python script and the interactive window [1]. Then I commit both script and ipynb version.

[0] https://code.visualstudio.com/docs/python/jupyter-support-py...

[1] https://code.visualstudio.com/docs/python/jupyter-support-py...

Re:Making Git and Jupyter Notebooks play nice by bobbylarrybobby on Friday November 29, 2019 @01:29AM (#21662505)
Agree 100%. Only thing I’d add is that the killer feature of the extension is that it allows one to treat ordinary python files as notebooks (without converting!) by 1. Connecting to a persistent kernel instance 2. Allowing the user to use magic comments to delineate code cells within the python file. With these two things, and the ability to export as a real notebook, you get the great experience of a notebook — submitting easily editable cells to a kernel one at a time, as many times as you want — without of all the usual baggage that that would entail. Plus you get to edit in a decent editor (and edit things other than just python files in it) instead of the crap Jupyter forces you to use.
Re:Making Git and Jupyter Notebooks play nice by Tarq0n on Friday November 29, 2019 @05:24AM (#21663480)
VSCode's solution is awesome. Rmarkdown works the same way, and it makes a lot of sense. Let code live as plaintext, it's native format, and only render results at runtime. Trying to preserve results in the file just makes things needlessly stateful.