I like my github repositories to include py files instead of ipynb files, but I much prefer working in Jupyter when doing projects.
I'd ideally like to work on my project by:
- Performing a git pull from the repository I'm working on, which contains a .py file that I've converted into a .py file from my Jupyter notebook
- Update the Jupyter notebook with changes before a commit
- Download the notebook as a py file and then make the commit, with the notebook file ignored by git
Is there a way to do this 'updating of the py file' without manually downloading my notebook in to a py file, taking the py file I downloaded in my Downloads folder, dragging it in my work directory and manually replacing the extant py file before finally making a commit? It just seems very unclean.
Perhaps I should have my ipynb in the repository as well, so that I can make sure that when I pull the notebook is up to date and is the exact same as the py file? But I would want it hidden from the public.
I just want to be able to make things as seamless as working with just py files, while doing actual work in Jupyter and then for the public having the final code be py files, but I want to do it relatively fluidly without a lot of manual dragging and dropping of files and replacing old ones. Kind of ruins the point of using git as I'm no longer using version control "elegantly".
ipynb
files instead? Two approaches to committingipynb
files are to strip the outputs (to minimize diffs) or to keep them as-is (which I prefer for reproducibility sake when doing research). What I think people do not realise is that there are excellent, highly customizable tools (jupyterlab-git, nbdime) allowing to create diffs of notebooks and that notebooks generally display well on GitHub (if kept to reasonable size, which is a good practice in the first place). – Arola