This repository is a Python package (src-layout) built and tested via uv.
This document is written for automated coding agents and human maintainers who want
consistent, low-friction changes.
- Keep changes minimal and scoped to the user request.
- Prefer repo-standard tooling and commands (see below) so CI matches local runs.
- Do not change
README.mdunless explicitly requested. - Avoid editing generated content under
docs/generated/. - When making behavioral changes, add or update tests under
tests/.
- Source:
src/polykin/ - Tests:
tests/(mirrors package subdomains likethermo/,kinetics/, etc.) - Docs (MkDocs Material):
docs/(includes tutorial notebooks underdocs/tutorials/) - CI workflows:
.github/workflows/
- Python >= 3.10 (see
pyproject.toml).
CI uses uv sync with uv.lock.
# From repo root
pip install uv
uv syncpip install uv
uv syncuv run --frozen pytestuv run --frozen pytest tests/thermo
uv run --frozen pytest -k "flash" -qCI runs a second pass with JIT disabled.
$env:NUMBA_DISABLE_JIT = "1"
uv run --frozen pytestTo re-enable in the same shell:
Remove-Item Env:NUMBA_DISABLE_JIT -ErrorAction SilentlyContinueProject config lives in pyproject.toml.
- Ruff (lint):
uv run ruff check .- Ruff (format):
uv run ruff format .If you change imports or add new modules, ensure Ruff import rules pass.
This repo includes a .pre-commit-config.yaml that runs Ruff lint and format via uv.
uv run --frozen pre-commit install
uv run --frozen pre-commit run --all-filesDocs build in CI using the docs dependency group:
uv sync --group docs
uv run mkdocs build -d _site- Identify the smallest set of files needed.
- Implement the change.
- Run targeted tests first, then the full suite if the change is broad.
- Run
ruff check .andruff format .if you changed Python files. - If docs are affected, run
mkdocs build.
- Keep functions/classes type-annotated where practical.
- Docstrings follow NumPy-style conventions (Ruff pydocstyle is enabled).
- Respect the repo line length (90) when formatting.
- Avoid adding new heavy dependencies without a clear need.
CI runs:
uv sync(both highest and lowest-direct resolution)pytestwith and without Numba JIT- docs build via
mkdocs build
When you need to replicate a CI failure locally, prefer running the exact uv run --frozen ... command.