Contributing
Thanks for wanting to contribute to AnyPINN! Please read our Code of Conduct before getting started.
Setup
-
Fork and clone the repo, then install dependencies:
Optional: If you use mise, run
mise installfirst to provision the pinnedpython,uv, andjustversions from.mise.toml. -
Before pushing, run the full CI check locally:
This runs lint, typecheck, and tests, the same pipeline as CI.
Tooling
Good to Know
- The
examples/directory has ready-to-run problems you can use to exercise the library end-to-end while developing. Each example has atrain.pyentry-point (uv run python train.py). exponential_decayis a minimal, core-only example (no Lightning).uv run anypinn create --list-templateslists all scaffold templates.- Keep the layer separation:
anypinn.corestays pure PyTorch, Lightning stays optional.anypinn.coremust not import fromanypinn.lightning,anypinn.problems, oranypinn.catalog. - If you change the architecture or data flow, update both
CLAUDE.mdandREADME.md.
Documentation
The docs live in docs/ and are built with MkDocs Material.
Preview locally
This starts a hot-reloading server at http://localhost:8000. Changes to Markdown files and source docstrings are picked up automatically.
Where to add content
| Content type | Directory | Example |
|---|---|---|
| Tutorials, walkthroughs | docs/getting-started/ |
"First Project" |
| Task-oriented how-to guides | docs/guides/ |
"Use CSV Data" |
| New model templates | docs/catalog/ |
"SIR Epidemic Model" |
| API reference | docs/reference/ |
Core, Problems, Lightning |
New pages must also be added to:
mkdocs.yml: thenav:section, or the page won't appear in navigation.docs/hooks/page_icons.py: thePAGE_ICONSdict, for sidebar icons.
API reference
The API reference is hand-curated, not auto-generated. Each public class is rendered using an explicit mkdocstrings directive:
When you add a new public class, add a corresponding ::: entry to the appropriate file in docs/reference/. Group related classes under section headers.
Versioning
Docs are versioned with mike. The CI workflow extracts the version from pyproject.toml and deploys with mike deploy. A version dropdown appears in the header of the deployed site.
Announcement banner
Use the announcement banner for release highlights or important notices. Add it
to mkdocs.yml:
Status badges
Mark pages as new, deprecated, or experimental by adding a status field
to the page's YAML front matter:
This shows a badge next to the page title in the sidebar. Use new for recently
added pages and deprecated for pages scheduled for removal.
Verify the build
Always build before pushing docs changes. The build runs in strict mode and will catch broken links and missing references:
Conventions
- Commits: Conventional Commits (
feat:,fix:,docs:,refactor:,test:,chore:) fix:triggers a patch release (e.g. 0.1.0 → 0.1.1)feat:triggers a minor release (e.g. 0.1.1 → 0.2.0)feat!:orBREAKING CHANGE:triggers a major release (e.g. 0.2.0 → 1.0.0)- Branch names:
feat/,fix/,docs/, etc. - Line length: 99
- Absolute imports only (no relative imports)
- All config dataclasses:
@dataclass(frozen=True, kw_only=True)