Contributing¶
Setup¶
pre-commit install runs Ruff (lint and format), notebook-output stripping, and basic
file hygiene checks before every commit. Install a CPU-only PyTorch first
(pip install torch --index-url https://download.pytorch.org/whl/cpu) if you do not
need a GPU build.
Checks¶
CI runs all of these on every pull request:
Coverage is uploaded to Codecov;
a pull request should not lower project coverage by more than 1 %, and new lines should
be at least 70 % covered. Prefer tests that fail when the code is wrong: assert on
values, and make sure the branch you are testing actually runs (--cov-report=term-missing
shows what was skipped).
Preview docs:
Open a pull request against main. Do not commit notebook outputs, model weights, or
audio files. Keep commits logical (one feature or fix each): pull requests are rebased,
not squashed.
Code notes¶
- Prefer
ASRAttackerwhen you need a backend (Hugging Face or a custom CTC model).ASRAttacksis the same attacks with a module-plus-labels constructor. - Keep attack math in
src/asr_attacks/attacks/and model I/O insrc/asr_attacks/backends/. - If an implementation differs from the named paper, say so in the docstring and in algorithms.
- Public APIs need Google-style docstrings; MkDocs pulls them into the API reference.