Contributing Guide
Thank you for your interest in contributing to kreview! This guide covers everything you need to get started.
๐ Git Branching Model
We use a simplified Git Flow strategy:
gitGraph
commit id: "v0.0.3"
branch develop
commit id: "feat: labels"
commit id: "feat: eval engine"
branch feature/new-evaluator
commit id: "feat: GC evaluator"
checkout develop
merge feature/new-evaluator
checkout main
merge develop tag: "v0.1.0"
Use mouse to pan and zoom
| Branch | Purpose |
|---|---|
main |
Production-ready releases only. Protected. |
develop |
Integration branch. All PRs target here. |
feature/* |
Short-lived branches for individual features/fixes. |
๐ Commit Convention
We follow Conventional Commits:
| Type | When to use |
|---|---|
feat |
A new feature or evaluator |
fix |
A bug fix |
docs |
Documentation changes only |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or updating tests |
ci |
CI/CD workflow changes |
chore |
Maintenance (deps, config, cleanup) |
Examples:
git commit -m "feat(labels): add Insufficient Data tier for low-depth samples"
git commit -m "fix(duckdb): add exponential backoff retry for transient I/O failures"
git commit -m "docs(biology): update feature count to 26 evaluators"
๐ง Development Setup
git clone https://github.com/msk-access/kreview.git
cd kreview
pip install -e '.[dev,test,docs]'
nbdev-install-hooks
pre-commit install
โ The Golden Rule
Never edit .py files directly
All Python files in kreview/*.py are auto-generated by nbdev from the Jupyter notebooks in nbs/. If you need to change code:
- Edit the corresponding notebook in
nbs/ - Run
nbdev-exportto regenerate the.pyfiles - If you accidentally edited a
.pyfile, runnbdev-updateto sync backwards
โ Pull Request Checklist
Before submitting a PR, make sure you've completed all of these:
- Code changes are made in
nbs/*.ipynb(not.pyfiles) - Configuration limits sync: Check if
nextflow/nextflow.configrequires reciprocal variable syncing. -
nbdev-exporthas been run after any version bumps and.pyfiles are in sync -
nbdev-cleanhas been run to strip notebook metadata -
ruff check .passes with no errors -
python -m black .has been run globally (formatting natively over notebooks and python sources) -
pytest --cov=kreviewpasses - Documentation is updated if public APIs changed
- Changelogs Sync:
CHANGELOG.mdperfectly copied todocs/changelog.md - Commit messages follow Conventional Commits format
- PR targets the
developbranch (notmain)
๐ Code Review Standards
PRs are reviewed for:
- Correctness: Does the code do what it claims?
- Biological accuracy: Are domain assumptions valid?
- Observability: Are failures logged explicitly (no silent
except: pass)? - Test coverage: Are edge cases covered?
- Documentation: Are docstrings and docs pages updated?
๐งช Pre-commit Hooks
The following hooks run automatically on every commit:
| Hook | Purpose |
|---|---|
trailing-whitespace |
Removes trailing whitespace |
end-of-file-fixer |
Ensures files end with a newline |
check-yaml |
Validates YAML syntax |
check-added-large-files |
Prevents committing large binaries |
ruff |
Python linting with auto-fix |
nbqa-black |
Black formatting inside notebooks |
nbqa-ruff |
Ruff linting inside notebooks |