tests: split the grab-bag module, share the builders, move benches out, and close the coverage gaps found in review

Aperta
#292 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, pytorch
Ambito
testing

Direzione di ricerca

Start with tests/test_util.py and conftest.py, where the shared chunk, read and alignment builders would move, then check signal_refine.py lines 101-141 for the pickle cache that needs an autouse redirect to a temp dir. Work through the listed coverage gaps in training.py (lines 789-794) and commands/merge_split.py (lines 44-88). Done means the split modules collect with no slower collect time, each gap has a test or a stated reason, and CI runtime is reported before and after.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement review-2026-09

Tier P3 · effort M · from the 2026-09-13 review (CLI F15; models F16; training F15; inference F23; prep F15)

Structure: tests/test_util.py (1,686 lines) holds TestComputeMetrics,
TestLoadModelFromCheckpoint, TestModelBundle, TestAggregatePairwise,
TestModelExport, TestVmapBundle, TestVmapInferenceIntegration,
TestResolvePairLabels. def make_chunks is defined in four files,
_make_synthetic_read and _make_mock_alignment in two each;
conftest.py's sample_chunks serves one shape. signal_refine.py:101-141
writes levels.txt.pkl (5.5 MB) beside tests/fixtures/levels.txt and
src/leech/data/*.pkl on first run. Four tests/bench_*.py are not collected
and two point at /path/to/reads.bam. 1,598 tests collect in 12.9 s.

Gaps, each named by the reviewer that found it:

  • models: test_all_models_forward covers 10 of 29 names with torch.randn for the one-hot sequence; the export test covers 1; no (B, 36, L) test for the hand-written classes; no 2-channel TCNDwellResidual forward outside the parity file; no batched-vs-per-sample augmentation distribution test; CRF has no end-to-end CPU "train two epochs, loss falls, decode improves" test; 8 CUDA-only tests never run in CI.
  • training: no test runs the adversarial/CL head through torch.compile (a CPU test with backend="eager" would; if the pre-hook is not traced, _adversarial_loss returns zero silently, training.py:789-794).
  • inference: Remora loading (is_remora, RemoraModelWrapper, _extract_remora_metadata) has zero tests; eval on a multiclass checkpoint is untested; _write_mega_batch_predictions binary MP/ML only via fixture integration.
  • prepare: focus_map is only tested as a bypass reason; _propagate_prepare_config (commands/merge_split.py:44-88) has no test.
Acceptance criteria
  • test_util.py is split by module under test; the chunk/read/alignment builders live in conftest.py with parameters for shape; bench_*.py move to scripts/bench/ with real fixture paths or are deleted; the pickle cache is redirected to a temp dir under pytest by an autouse fixture.
  • Each gap above has a test, or a one-line reason in the PR why not.
  • Collect time does not grow; CI runtime is reported before/after.
Non-goals
  • Enabling xdist in CI (the memory note: it stalls under srun; the 4-minute job does not need it).
Lingua principale
Python
Stelle
0
Fork
0
Merge medio
11h 17m
PR unite (30g)
23

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rnabioco/leech

Tutte le issue di rnabioco/leech

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.