chunk format: one `CHUNK_FIELDS` spec, ASCII text in `ChunkSpool`, one BAM tag parser

Aperta
#288 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
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
data

Direzione di ricerca

Start with the four copies of the chunk field list in chunking/serialization.py (iter_chunk_columns, load_chunks), chunking/table.py (_INT_FIELDS/_TEXT_FIELDS), and the classifier in tests/test_backend_parity.py, then the -5/5 defaults near line 381. Done means one CHUNK_FIELDS spec feeds all of them, ChunkSpool stores text as S widened blockwise, tests/test_chunk_writer.py still passes with identical .npz bytes, and the parity test fails on an unclassified field.

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 (prep F7, F10, F12)

  • The chunk record's field list is spelled four times: chunking/serialization.py:349-477 (iter_chunk_columns, write), :1044-1176 (load_chunks, read as dicts), chunking/table.py:28-47 (_INT_FIELDS/_TEXT_FIELDS, read as columns), and the classifier in tests/test_backend_parity.py. serialization.py:381-382 defaults feature_start/feature_end to literal -5/5 — a third spelling of the rule resolve_feature_window centralised in #189 (never hit, since both backends set them, but a trap).
  • ChunkSpool keeps every text member as <U in RAM (serialization.py:720-724): read_ids U36 (144 B), sequences_with_kmer_context ~U56 (224 B), sequences U11 (44 B) plus three small ones ≈ 450 B/chunk ≈ 3 GB at 6.7M chunks — the dominant RSS of data prepare now that arrays spill; text_column() (:748-760) then concatenates a second transient copy. table.py:144-165 already reads text as fixed-width S.
  • mv/ns/ts are parsed in io/bam_reader.py:151-157 (ReadInfo.__init__) and again in features.py:131-155 (extract_move_table); CL in bam_reader.py:160-166 and preparation/reader.py:277-281.
Acceptance criteria
  • One CHUNK_FIELDS spec (field, member, dtype, missing sentinel, is_text) consumed by the writer, the dict loader, ChunkTable and the parity test's classifier; _text() and the -1 sentinels are properties of the spec; the -5/5 literals are gone. Adding a field is one edit plus its parity classification.
  • ChunkSpool holds text as fixed-width S and widens to <U blockwise in _write_text_member; the .npz bytes are identical (tests/test_chunk_writer.py); peak RSS of data prepare on the fixture drops (record it).
  • MoveTable.from_alignment(aln) is the single tag parser; ReadInfo and extract_move_table delegate; ReadInfo.from_alignment owns CL.
  • tests/test_backend_parity.py still fails on an unclassified field.
Non-goals
  • The struct-of-arrays Rust return (separate issue), though this spec is what it should target.
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.