Project conventions¶
Package layout rules¶
src/is the import root. Tests handle this intests/conftest.py; scripts needPYTHONPATH=srcset explicitly.- The three top-level packages are
dataset/,depth_fm/, andclip/. Cross-package imports flowclip → datasetanddepth_fm → dataset, never the reverse. - Entry-point scripts live under
scripts/and are not part of the importable library. Library code lives insrc/.
Where to put new code¶
Use the routing table from the overview. A few of the most common entries:
| Task | File |
|---|---|
| Add a loss | src/depth_fm/objectives/losses.py |
| Add a metric | src/depth_fm/objectives/metrics.py |
| Change training loop | src/depth_fm/training/lightning_module.py |
| Change sampling / split logic | src/dataset/sampling/sampler.py |
| Change PDS download / footprint | src/dataset/core/base.py |
| New publication figure | scripts/visualization/ |
Style¶
- Public APIs use Google-style docstrings —
mkdocstringsis configured to render them. - Type hints on all public function signatures.
- Prefer dataclasses over kwargs-on-kwargs.
- No emojis in code or comments unless explicitly requested.
Commits & PRs¶
- Branch from
master. Open PRs intomaster. - CI runs the docs build on every PR that touches
src/,docs/,properdocs.yml, orscripts/architecture/. A failing build blocks merge. - Tests run under
uv run pytest tests/ -m "not integration" -n auto.