A lightweight template to help teams collaborate with Jupyter Notebooks in VS Code.
- Use the template to create a new repository.
- Open in VS Code (at this time it must be VS Code Insiders).
- Install the recommended exentsions when prompted.
- Open a terminal and run:
pip install -r requirements.txt
. - Run:
pre-commit install
. - Create
.py
files as needed, then right click a file and selectOpen as a Jupyter Notebook
to open in a notebook format.
The template is ready for continuous integration out of the box. All that is needed is to sign-in, using GitHub, here: https://pre-commit.ci/.
- Why use this template?
- This template helps when you want to use notebooks with version control (Git).
.ipynb
files store and update metadata that makes version control hard. This template solves this problem using extenstions that let you work with.py
scripts through a notebook interface. It also usepre-commit
to enforce consistent styling of these scripts.
- This template helps when you want to use notebooks with version control (Git).
- Why can't I open my
.py
file as a notebook (more than once)?- This template is affected by the following issue: notebookPowerTools/vscode-jupytext#9. The issue means that the same
.py
file cannot be opened as a notebook twice in succession. The issue can be worked around by alternating between two.py
files.
- This template is affected by the following issue: notebookPowerTools/vscode-jupytext#9. The issue means that the same
- Why do I get an error message when trying to make a commit?
- If black makes a change to a file, an error message will be displayed. This is intentional - see the answer from the author here: https://stackoverflow.com/questions/58398995/black-as-pre-commit-hook-always-fails-my-commits. Review the applied changes and commit again if you are happy.