Contributing
Thank you for your interest in morel.
Setup
git clone https://github.com/sachncs/morel.git
cd morel
python -m pip install -e ".[dev]"
Workflow
Create a branch from
master.Make focused changes.
Run the local checks:
make lint make format make typecheck make testAll four must pass before opening a PR.
Update
CHANGELOG.mdunder[Unreleased].Open a pull request against
master.
Commit messages
Use Conventional Commits:
feat(scope): add new algorithm
fix(scope): correct behaviour
chore(deps): bump numpy
docs: clarify API
test: add coverage for retrieval determinism
refactor: rename _backtrack to backtrack
Code style
- Use public names for supported APIs and a leading
_for implementation details or semi-private extension points; followdocs/engineering.md. - Prefer direct domain names over redundant
get_/compute_/make_prefixes. - Strict mypy: every public function has typed parameters and return type.
- Test coverage: every new module gets a
tests/unit/<package>/test_<module>.py. - No print statements in library code — use the
morel.core.loglogger.
Architecture
The reference layering is:
cli → app
app → train | eval
train → model | data | core
eval → model | data | core
model → data | core
data → core
core → (nothing in morel)
Adding a new algorithm:
- Define a
Protocolin the appropriate subpackage. - Implement the algorithm.
- Add a typed adapter to the owning package's private factory registry and
expose only the package's
KINDmapping for introspection. For ablations, add the transform tomorel.eval.ablation.KIND. - Add unit, property, and research validation tests.
Release process
- Add a matching
## [MAJOR.MINOR.PATCH]section todocs/project/changelog.md. - Push an annotated
vMAJOR.MINOR.PATCHtag.setuptools_scmderives the package version from that tag. - The release workflow builds one wheel, verifies its metadata against the tag and changelog, checks the package metadata, generates an SBOM, and then publishes to PyPI via OIDC trusted publishing.
The workflow is tag-only so a branch or manually dispatched job cannot publish an unversioned development build.
Contact
- General questions: GitHub Discussions.
- Security: see
SECURITY.md.