bacformer/: Python package (modeling, preprocessing, TL). Entry modules live undermodeling/,pp/, andtl/.tests/: Pytest suite organized by area (modeling/,tl/,pp/).tutorials/: Jupyter notebooks demonstrating core tasks.scripts/: Small utilities used during development.files/: Sample assets (e.g.,pao1.gbff, images).ai_docs/,.claude/: Design and agent notes (keep synced with code).
- Install (dev + tests):
pip install .[dev,test](Python >= 3.10). - Lint/format:
ruff check .andruff format .(orpre-commit run -a). - Tests:
pytest -q(or with coverage:pytest --cov=bacformer). - Build wheel:
hatch build(uses Hatchling perpyproject.toml). - Pre-commit:
pre-commit installthen commit; CI expectations mirror hooks.
- Formatter/linter: Ruff (120 char lines, import sorting, numpy-style docstrings). No nb formatting in CI.
- Indentation: 4 spaces; UTF-8; Unix line endings.
- Naming:
snake_casefor modules/functions,PascalCasefor classes,UPPER_SNAKE_CASEfor constants. - Public APIs live in
bacformer/__init__.pyand subpackage__init__.py; keep imports explicit.
- Framework: Pytest; tests under
tests/; name filestest_*.pyand functionstest_*. - Coverage: target meaningful lines in
bacformer/; avoid testing tutorials and data assets (see coverage omit inpyproject.toml). - Use small, deterministic fixtures; prefer CPU paths when possible.
- Style: Conventional prefixes (feat, fix, refactor, docs, test, chore); keep subject imperative and concise.
- Commits should be focused; include brief rationale when non-obvious.
- PRs: clear description, linked issues (
Fixes #123), test updates, before/after notes for behavior, and any performance/memory impact. - Run
pre-commit run -aandpytestlocally before opening the PR.
- GPU is optional; CPU tests should pass. Flash-Attn and FAESM are optional extras.
- Pin heavy deps only when required; prefer feature flags/extras (
.[faesm]).