Contributing & Docstrings#
Contributing#
Contributions are welcome: bug fixes, documentation, tests, performance work, and new extensions. Small, self-contained fixes can go straight to a pull request. For larger or model-behavior changes (anything that could change the public API or shift results against the validation targets), please open an issue on GitHub first to align on the approach.
See CONTRIBUTING.md for the full guidelines, quality bar, and code of conduct.
Pull Request Guidelines#
Fork the repository
Create a feature branch off
main(git checkout -b feature/my-feature)Make changes and add tests
Run the full test suite (
pytest); keep coverage at 99%Run code quality checks (
ruff format . && ruff check --fix . && mypy)Ensure all randomness goes through
sim.rngfor reproducibilityCommit with a descriptive message
Push and open a pull request against
main, linking the related issue
Docstring Style#
BAM Engine uses NumPy-style docstrings. See the NumPy docstring guide for the format specification.
Example:
def my_function(param1: float, param2: int) -> bool:
"""
Short description of the function.
Longer description if needed.
Parameters
----------
param1 : float
Description of param1.
param2 : int
Description of param2.
Returns
-------
bool
Description of return value.
Examples
--------
>>> my_function(1.0, 2)
True
"""
pass
Release Checklist#
Update version in
src/bamengine/__init__.pyUpdate
release_history.rstRun full test suite:
pytestRun code quality checks:
ruff format . && ruff check --fix . && mypyBuild docs:
cd docs && sphinx-build -b html . _build/htmlTag release:
git tag vX.Y.ZBuild and publish:
python -m build && twine upload dist/*