This repo assumes a python version of at least 3.13. All other requirements are listed in requirements.txt and can just be pip-installed.
We use Black and isort for code formatting, and automate this using pre-commit. We keep notebooks clean using nbstripout.
To install requirements and apply the style:
pip install -r requirements.txt
pre-commit install
pre-commit run --all-files
If the CI fails for a PR you'd like to merge, it means that your changes don't adhere to the style guide.
To fix this, run pre-commit run --all-files locally, then commit and push again.
If black applies auto-formatting that is really nonsensical, you can force it to ignore a code block like this:
# fmt: off
print("...")
# fmt: on
We use pytest for unit testing. Install it with pip install pytest and then run pytest from the repository root to run all tests.