This document explains how to set up the development environment for working with and reproducing notebook publications.
This repository uses conda to manage the computational and build environment. If you don't have it installed (check with conda --version), you can find operating system-specific instructions for installing miniconda here.
When you're ready, run the following commands to create and activate the environment. Replace [REPO-NAME] with your repository name.
conda env create -n [REPO-NAME] --file env.yml
conda activate [REPO-NAME](As you introduce dependencies to your publication, or if you already have your full set of dependencies, add them to env.yml with the version pinned.)
Now, install any internal packages in the repository:
pip install -e .And finally, install the pre-commit hooks. This is optional but recommended:
pre-commit installTest your installation with make preview. Your pub will open up in your browser.
Afterwards, create a branch to work on (don't commit to main directly).
When working with Jupyter notebooks:
- Edit
index.ipynbas your main publication file - Use
make previewto see changes in real-time - Run
make executebefore committing to update_freeze/with execution results
The Makefile provides several useful commands for development:
make lint: Run linting checks using ruffmake format: Automatically format code using ruffmake pre-commit: Run all pre-commit hooksmake test: Run pytest tests, if they existmake bump-version: Update version number