Contributing¶
Contributions of all sizes are welcome — bug fixes, new cell or converter models, and documentation improvements.
Development setup¶
Clone and install everything in one go:
This installs runtime dependencies plus the dev and docs groups (and pulls notebooks transitively via docs). See Installation for per-group setups.
Running tests¶
All tests should pass on a clean checkout. The suite runs in under 10 seconds on a modern machine.
Some subsystems use parameterised spec registries (CellModelSpec, ConverterModelSpec, CalendarModelSpec, CyclicModelSpec) so that adding a new shipped model automatically pulls in the generic test coverage. See the extension guides for the per-subsystem pattern.
Linting and formatting¶
CI enforces both. Run them locally before opening a PR — the ruff check output tells you exactly what to fix, and ruff format is idempotent. Spelling is checked with codespell on the same CI step.
Building the docs¶
Starts a live-reloading preview at http://127.0.0.1:8000. The -w src/simses flag extends the watcher to the source tree so docstring edits trigger a rebuild (the default only watches docs/).
To reproduce the CI build locally:
--strict fails on any warning — broken cross-references, missing nav entries, etc. Always the last gate before shipping a docs change.
Style conventions¶
- Code style:
ruff formathandles formatting;ruff checkenforces lint rules. The rule selection is inpyproject.toml. - Docstrings: Google style, as configured in
mkdocs.yml. ConstructorArgs:live on__init__, not the class docstring. - State is data, logic is code: all mutable state goes in plain
@dataclassobjects; methods live on the companion class. See CLAUDE.md for the project-level design principles. - Protocols at extension points: new behaviour that varies between implementations (loss models, aging laws, HVAC, etc.) goes through a
typing.Protocol, not subclassing.
Pull request process¶
- Open an issue first for anything non-trivial — it's cheaper than rewriting a PR.
- Fork + branch from
main. Keep the branch focused on one change. - Run tests, ruff, and a strict docs build locally before pushing.
- Open a PR with a short summary of why the change is needed (not just what).
- CI will re-run tests, lint, and strict docs. Fix any failures before requesting review.
Reporting issues¶
Bug reports and feature requests go on the GitHub issue tracker. For bugs, include:
- Python version (
python --version). - simses version (
git rev-parse HEADfor a source install). - A minimal reproducing example — the smaller the snippet, the faster the fix.
Licensing¶
By contributing you agree that your contributions will be released under the same BSD 3-Clause License as the rest of the project.