Contributing¶
Keep analysis helpers small, documented and tested. CLAUDE.md in the
repository holds the full set of conventions and the reasons behind them; this
page is the working summary.
Set up¶
git clone https://github.com/EngreitzLab/crispr-analysis-utils.git
cd crispr-analysis-utils
pixi install -e dev
pixi run -e dev install-hooks # the commit and push hooks
pixi is the default environment: it is the only one with GEM3.
What the hooks and CI enforce¶
- 4-space indentation and no tab characters. ruff formats Python, including the Python blocks in Markdown; markdownlint checks Markdown; JSON is formatted at 4 spaces. YAML stays at 2.
ruff checkpasses, with the rules set inpyproject.toml.- No file over 512 KB, except the generated
uv.lockandpixi.lock. Data never goes in git; build test fixtures inside the tests. - No commit on
main: work on a branch and open a pull request.mainaccepts only pull requests whose CI checks pass. uv.lockandpixi.lockmatchpyproject.toml: after changing a dependency, runuv lockandpixi lockand commit both.
Commit messages¶
Start with an UPPERCASE verb: ADD, FIX, UPDATE, REWRITE, RELEASE or
REMOVE, then say what changed, for example
FIX counts_per_million accepting a NaN pseudocount.
Adding a module¶
- Write the module under
src/crispr_analysis_utils/, with NumPy-style docstrings. - Re-export its public functions from
src/crispr_analysis_utils/__init__.pyif they belong at the top level. - Add its skill,
src/crispr_analysis_utils/skills/cau-<module>/SKILL.md, and, only if using the module is a long multi-step job, an agent insrc/crispr_analysis_utils/agents/that preloads that skill. See Agents and skills. - Map the new skill or agent to the module in
COVERAGE, intests/test_skills.py. - Add an API reference page under
docs/reference/, and its entry in themkdocs.ymlnav and on the Agents and skills page. - Add focused tests under
tests/. Tests must not write outsidetmp_path. - If the module has a command, add a
causubcommand module undersrc/crispr_analysis_utils/cli/and register it inCOMMANDS. Import optional dependencies inside itsrun().
Documentation style¶
Functions use NumPy-style docstrings:
def my_function(x: float) -> float:
"""Short summary.
Parameters
----------
x
Description of the input.
Returns
-------
float
Description of the output.
"""
A docstring says what the function does, takes, returns and raises. Design rationale and measurements belong in the documentation pages.
Checks¶
Run these before opening a pull request:
pixi run -e dev test
pixi run -e dev lint
pixi run -e docs docs-build