Does anyone have any good tools for this that preserve the visuals of the Notebooks.
My approach has always been rendering the files as .py without the cell outputs and comparing which is a big PITA.
Anyone have any advice?
https://github.com/mwouts/jupytext/blob/main/docs/paired-not...
It works both ways, it can update the .py file each time you save the notebook, or you can edit the .py file and have the jupytext command line tool update the .ipynb.
One option would be to start a policy to always “restart and clear output” before saving. This cleans the output cells and makes the .ipynb files diffable. Just happens to also make them nice for storing in version control.
Another option would be to work in pure python files in the first place, and only use Jupyter after the fact. The close brother to Jupyter is the Spyder IDE, which gives you most of the benefits of quick visual outputs, but also has a nice python debugger built in.
Once the hook was in place git diff worked well enough to not need any other diffing tool.
[1] nbdime to view local diffs & merge changes
[2] jupytext for 2-way sync between notebook & markdown/scripts
[3] JupyterLab git extension for git clone / pull / push & see visual diffs
[4] Jupyerlab gitplus to create GitHub PRs from JupyterLab
[5] ReviewNB for reviewing & diff'ing notebook PRs / Commits on GitHub
Disclaimer: While I’m the author of last two (GitPlus & ReviewNB), I’ve represented the overall landscape in an unbiased way. I've been working on this specific problem for 3+ years & regularly talk to teams who use GitHub with notebooks.
[1] https://nbdime.readthedocs.io
[2] https://jupytext.readthedocs.io
[3] https://github.com/jupyterlab/jupyterlab-git
You end up with files which are syntactically correct code, versionable, and can be run in segments just like ipynb. Win, win, win.
http://timstaley.co.uk/posts/making-git-and-jupyter-notebook...
You can prettify it via "python3 -m json.tool" for example. Then you have a structure that you can diff via your favorite diff tool.
What is a pita about it?