nirs4all.data.repetition_detection module
Repetition (biological replicate) group detection.
Heuristics for recovering “which measurements belong to the same biological sample” from dataset metadata columns or sample-id naming conventions.
These previously lived in the nirs4all-studio HTTP layer; they are NIRS data semantics and belong to the library (the studio’s 2026-06-05 tech-debt closeout flagged the boundary violation).
Two entry points:
auto_detect_repetition_column()— pick the metadata column that most plausibly identifies biological samples (bio_sample,sample_group, …), skipping partition/fold bookkeeping and repeat-index columns.detect_repetition_groups()— group sample ids into biological samples using an explicit regex or a ladder of common naming conventions (name_rep1,name_2,name-A,name (1)).