Contributing to eSDIva¶
Thank you for your interest in contributing to eSDIva!
Development setup¶
-
Clone the repository:
-
Install dependencies (including dev tools):
- Install just tool
- Run the test suite:
- Run pre-commit hooks:
Contributing with AI tools¶
The development checkout ships a ready-made AI-agent architecture so that contributions made with modern coding assistants still respect the physics and the design philosophy of the package. When you clone the repo (or install the dev extra), you get:
CLAUDE.md— a project brief the agent reads on every session: architecture map, the SIR/SDI physics, unit conventions, and the "audience-first, physics-first" documentation rules..claude/rules/— focused rule files loaded by context (coding guidelines, SIR/SDI physics, transducer conventions, attenuation) plus doubt-driven development (never assert an untested physical cause).graphify-out/— a knowledge graph of the codebase (god nodes, communities, cross-file relationships) that an agent can query for scoped context instead of grepping the whole tree; regenerate it withgraphify update .after code changes.
These files are written for Claude Code but the
conventions are plain Markdown — adapt them to Cursor, Copilot, or any other
assistant (e.g. copy the rules into AGENTS.md / .cursorrules). The intent is
that an agent contributing to eSDIva produces code that is physically correct,
documented for ultrasound researchers, and consistent with the rest of the package.
Code style¶
- Formatter: Ruff (Black-compatible)
- Linter: Ruff (configured in
pyproject.toml) - Type checker: ty
- Docstrings: NumPy style
Pre-commit hooks enforce all of these automatically.
Running tests¶
# Run all tests
just test
# Run with verbose output
just test-verbose
# Run only unit tests
uv run pytest tests/unit/ -v
# Run only integration tests
uv run pytest tests/integration/ -v
# Run with coverage
uv run pytest tests/ --cov=esdiva --cov-report=term-missing
Adding a new transducer type¶
- Create a new class inheriting from
TransducerBasein the appropriate file undersrc/esdiva/transducers/ - Implement
_compute_element_centers()to define element positions - Implement
_build_subdivisions()to generate rectangular patches - Export the new class in
src/esdiva/transducers/__init__.py - Add tests in
tests/unit/test_transducers/ - Add documentation in
docs/api/transducers.md
Pull request workflow¶
- Create a feature branch from
main - Make your changes with tests
- Run
just pre-committo verify code quality - Run
just testto verify all tests pass - Open a PR with a clear description of the changes