Repository navigation
[FIX,API,TEST] Key the Sample* design mappings by sample name - #9874
Conversation
📝 WalkthroughWalkthrough
ChangesExperimentalDesign mapping corrections
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/openms/include/OpenMS/METADATA/ExperimentalDesign.h (1)
212-213: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the required Doxygen block format for changed API documentation.
src/openms/include/OpenMS/METADATA/ExperimentalDesign.h#L212-L213: Convert thegetSampleToPrefractionationMapping()documentation to a/** */block with@brief.src/openms/include/OpenMS/METADATA/ExperimentalDesign.h#L243-L244: Convert thegetSampleToConditionMapping()documentation to a/** */block with@brief.src/openms/include/OpenMS/METADATA/ExperimentalDesign.h#L256-L258: Convert thegetNumberOfSamples()documentation to a/** */block with@briefand@return.As per coding guidelines, “Doxygen comments must use
/** */with@tags;@briefis required.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/METADATA/ExperimentalDesign.h` around lines 212 - 213, Update the documentation for getSampleToPrefractionationMapping() at src/openms/include/OpenMS/METADATA/ExperimentalDesign.h:212-213 to use a /** */ Doxygen block with `@brief`; apply the same format to getSampleToConditionMapping() at :243-244, and add both `@brief` and `@return` tags to getNumberOfSamples() at :256-258.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/tests/class_tests/openms/source/ExperimentalDesign_test.cpp`:
- Around line 803-836: Extend the test setup around designWithSampleNames to
create a factor-based ExperimentalDesign using SampleSection::addSample with
each sample’s name, sample factor, and a non-replicate factor such as “control”.
Add assertions that getSampleToConditionMapping() contains every sample name and
that getPathLabelToConditionMapping(false) resolves both samples through the
factor-backed condition mapping, covering the getFactors() branch.
---
Nitpick comments:
In `@src/openms/include/OpenMS/METADATA/ExperimentalDesign.h`:
- Around line 212-213: Update the documentation for
getSampleToPrefractionationMapping() at
src/openms/include/OpenMS/METADATA/ExperimentalDesign.h:212-213 to use a /** */
Doxygen block with `@brief`; apply the same format to
getSampleToConditionMapping() at :243-244, and add both `@brief` and `@return` tags
to getNumberOfSamples() at :256-258.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1dd4fa21-d583-4524-af75-768780b37ccf
📒 Files selected for processing (4)
CHANGELOGsrc/openms/include/OpenMS/METADATA/ExperimentalDesign.hsrc/openms/source/METADATA/ExperimentalDesign.cppsrc/tests/class_tests/openms/source/ExperimentalDesign_test.cpp
ExperimentalDesign's two Sample* mappings have the same signature and opposite key spaces: getSampleToPrefractionationMapping() is keyed by sample NAME, getSampleToConditionMapping() used the stringified zero-based sample row index. Both getPathLabelTo* consumers resolved them by stringifying that index, so the prefractionation one asked a name-keyed map for "0" and threw a bare std::out_of_range -- "map::at", naming neither the sample nor the design. It works only when the names ARE the stringified indices, which is exactly what fromIdentifications() and fromConsensusMap() mint (sample_name = toStr(sample)). Every design a human or sdrf-pipelines writes breaks: sdrf-pipelines numbers samples from 1, so even purely numeric names never coincide with their 0-based rows. Epifany's extended model reaches this path. Both mappings are keyed by name now and both lookups go through it. SampleSection::getSampleName() cannot provide the reverse -- it reads the "Sample" COLUMN of the content, which a section built with addSample(), or inferred from a map, does not have -- so sampleRowToName_() reverses the authoritative name->row store instead. The factorless getSampleToConditionMapping() branch also ran to i <= getNumberOfSamples() and reported one sample more than the section holds; it now enumerates the actual samples. getNumberOfSamples() is documented as "highest sample index" but returns the row count; with zero-based samples those differ by one, and that comment is how this class of bug gets written. Corrected. BREAKING for getSampleToConditionMapping()'s keys. It has no in-tree caller and no pyOpenMS binding, so the practical blast radius is the two consumers fixed here. The new test builds designs named "1"/"2" (the sdrf-pipelines shape) and "BSA1"/"BSA2", and asserts both mappings cover every sample by name and that both per-(path,label) resolutions succeed. It fails on develop with "Caught unexpected std::exception - Message: map::at". Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…d ones
A sample name lives in two places in SampleSection, and which one is
filled depends on how the section was built. A parsed design file fills
the content table and a column called "Sample"; a section assembled with
addSample() - which is how fromConsensusMap() and fromIdentifications()
build theirs - fills only the name->row store and pushes an empty content
row.
getSampleName() read only the column:
return content_.at(sample_row).at(columnname_to_columnindex_.at("Sample"));
so it threw std::out_of_range for every inferred design, even though the
name was sitting in sample_to_rowindex_ the whole time. annotateColumnHeaders()
worked around it by catching the throw and dropping the name.
It now answers from the column when there is one and falls back to the
name->row store, which every construction path fills. A row that exists
in neither raises ElementNotFound naming the row and the section size,
instead of a bare "map::at". getSampleRow() gets the same treatment for
an unknown name.
Behaviour change worth knowing: an inferred design now annotates a
sample_name onto consensus map headers where it previously annotated
none, because the workaround no longer fires. No shipped reference moves
- the only test that reaches annotateColumnHeaders passes -exp_design, so
a parsed design, which always had the column. That is exactly why the
path was never covered, so both halves are now tested directly.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/tests/class_tests/openms/source/ExperimentalDesign_test.cpp`:
- Around line 828-829: Update the assertions in the cmap header test to validate
the actual sample_name metadata values, expecting "0" for the first header and
"1" for the second, rather than only checking key existence. Keep the existing
header access through getColumnHeaders().at() and assert both generated names.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 71a73fb9-0820-4b30-8ee5-bbcda7b2cbff
📒 Files selected for processing (2)
src/openms/source/METADATA/ExperimentalDesign.cppsrc/tests/class_tests/openms/source/ExperimentalDesign_test.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
- src/openms/source/METADATA/ExperimentalDesign.cpp
| TEST_TRUE(cmap.getColumnHeaders().at(0).metaValueExists("sample_name")) | ||
| TEST_TRUE(cmap.getColumnHeaders().at(1).metaValueExists("sample_name")) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Assert each annotated sample_name value.
These assertions only verify that the metadata key exists. Incorrect or duplicated sample names would pass this test. Assert the expected generated names, "0" and "1", for the two headers.
As per coding guidelines, write unit tests for new functionality and update relevant tests.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/tests/class_tests/openms/source/ExperimentalDesign_test.cpp` around lines
828 - 829, Update the assertions in the cmap header test to validate the actual
sample_name metadata values, expecting "0" for the first header and "1" for the
second, rather than only checking key existence. Keep the existing header access
through getColumnHeaders().at() and assert both generated names.
Source: Coding guidelines
bdad383 to
91cddf0
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
…ow counts Phase 0.1 gave the QPX views a schema check and a row-count floor. Those catch a table that collapsed or lost a column; they say nothing about what is IN it. ParquetDiff gains 'out_tsv', which writes a table out as text sorted by primary key, and four references are pinned against that with FuzzyDiff: the pg view of ProteinQuantifier_19 (48 rows) and _18 (3 rows), and the pg (20 rows) and psm (4 rows) views of IsobaricWorkflow. Text rather than committed Parquet is the whole point. A binary reference can only ever be regenerated wholesale, which is exactly the operation that hides unrelated drift; a text reference is reviewable in a pull request and patchable line by line, and it puts QPX on the same footing as every other reference in the suite rather than inventing a second kind of artefact. The dump reuses the comparator's own canonical key encoding, so it cannot disagree with the comparison about what a primary key is, and it escapes tabs and newlines inside values so one row is always one line. Rows therefore come out in length-prefixed key order - 'TMT126' before 'TMT127C' before 'TMT131' - which looks unsorted but is deterministic and byte-comparable, which is what a reference needs. A file with no derivable key still dumps, in file order, with a warning saying so, because a reference built from it would be sensitive to how the producer ordered its rows. Comparison uses the shared relative tolerance with the absolute one set to ZERO. FuzzyDiff.ini's absdiff of 0.01 exists for "zero vs. epsilon" on unbounded quantities; the QPX views carry q-values and posterior error probabilities living in [0,1], where it deletes the assertion outright - in one fixture 68 of 104 PEPs are <= 0.01, so every one of them would compare equal to every other. Verified, not argued: perturbing a PEP by 0.005 turns the psm reference red, and that is a change the shared absdiff would have absorbed silently. Both references were shown to fail on purpose - a 5% intensity change and the q-value change above - and restored afterwards. Fixtures were chosen by float-path length, not table size. ProteinQuantifier reads a committed consensusXML and does no mzML parsing, feature finding, alignment or normalization; IsobaricWorkflow adds only reporter extraction; both keys are float-free. ProteinQuantifier_19's 48 rows are 4 fraction groups x 6 TMT labels x 2 anchors with 12-entry grouped_runs lists - the design melting, fraction-group keying and label assignment that OpenMS#9869/OpenMS#9874/OpenMS#9876 touched - so it now VERIFIES rather than assumes OpenMS#9876's claim that nothing changes at the default 'fractions:aggregate'. The feature view and both ProteomicsLFQ producers are deliberately NOT pinned. The feature key contains a float32 'rt' matched with zero tolerance, and ProteomicsLFQ picks its median-normalization reference map by feature count, so one extra feature on one platform shifts every intensity by a finite factor. Those wait for the normalization fix that will move them anyway. Part of OpenMS#9864 Phase 0.1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…ow counts Phase 0.1 gave the QPX views a schema check and a row-count floor. Those catch a table that collapsed or lost a column; they say nothing about what is IN it. ParquetDiff gains 'out_tsv', which writes a table out as text sorted by primary key, and four references are pinned against that with FuzzyDiff: the pg view of ProteinQuantifier_19 (48 rows) and _18 (3 rows), and the pg (20 rows) and psm (4 rows) views of IsobaricWorkflow. Text rather than committed Parquet is the whole point. A binary reference can only ever be regenerated wholesale, which is exactly the operation that hides unrelated drift; a text reference is reviewable in a pull request and patchable line by line, and it puts QPX on the same footing as every other reference in the suite rather than inventing a second kind of artefact. The dump reuses the comparator's own canonical key encoding, so it cannot disagree with the comparison about what a primary key is, and it escapes tabs and newlines inside values so one row is always one line. Rows therefore come out in length-prefixed key order - 'TMT126' before 'TMT127C' before 'TMT131' - which looks unsorted but is deterministic and byte-comparable, which is what a reference needs. A file with no derivable key still dumps, in file order, with a warning saying so, because a reference built from it would be sensitive to how the producer ordered its rows. Comparison uses the shared relative tolerance with the absolute one set to ZERO. FuzzyDiff.ini's absdiff of 0.01 exists for "zero vs. epsilon" on unbounded quantities; the QPX views carry q-values and posterior error probabilities living in [0,1], where it deletes the assertion outright - in one fixture 68 of 104 PEPs are <= 0.01, so every one of them would compare equal to every other. Verified, not argued: perturbing a PEP by 0.005 turns the psm reference red, and that is a change the shared absdiff would have absorbed silently. Both references were shown to fail on purpose - a 5% intensity change and the q-value change above - and restored afterwards. Fixtures were chosen by float-path length, not table size. ProteinQuantifier reads a committed consensusXML and does no mzML parsing, feature finding, alignment or normalization; IsobaricWorkflow adds only reporter extraction; both keys are float-free. ProteinQuantifier_19's 48 rows are 4 fraction groups x 6 TMT labels x 2 anchors with 12-entry grouped_runs lists - the design melting, fraction-group keying and label assignment that OpenMS#9869/OpenMS#9874/OpenMS#9876 touched - so it now VERIFIES rather than assumes OpenMS#9876's claim that nothing changes at the default 'fractions:aggregate'. The feature view and both ProteomicsLFQ producers are deliberately NOT pinned. The feature key contains a float32 'rt' matched with zero tolerance, and ProteomicsLFQ picks its median-normalization reference map by feature count, so one extra feature on one platform shifts every intensity by a finite factor. Those wait for the normalization fix that will move them anyway. Part of OpenMS#9864 Phase 0.1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…ow counts Phase 0.1 gave the QPX views a schema check and a row-count floor. Those catch a table that collapsed or lost a column; they say nothing about what is IN it. ParquetDiff gains 'out_tsv', which writes a table out as text sorted by primary key, and four references are pinned against that with FuzzyDiff: the pg view of ProteinQuantifier_19 (48 rows) and _18 (3 rows), and the pg (20 rows) and psm (4 rows) views of IsobaricWorkflow. Text rather than committed Parquet is the whole point. A binary reference can only ever be regenerated wholesale, which is exactly the operation that hides unrelated drift; a text reference is reviewable in a pull request and patchable line by line, and it puts QPX on the same footing as every other reference in the suite rather than inventing a second kind of artefact. The dump reuses the comparator's own canonical key encoding, so it cannot disagree with the comparison about what a primary key is, and it escapes tabs and newlines inside values so one row is always one line. Rows therefore come out in length-prefixed key order - 'TMT126' before 'TMT127C' before 'TMT131' - which looks unsorted but is deterministic and byte-comparable, which is what a reference needs. A file with no derivable key still dumps, in file order, with a warning saying so, because a reference built from it would be sensitive to how the producer ordered its rows. Comparison uses the shared relative tolerance with the absolute one set to ZERO. FuzzyDiff.ini's absdiff of 0.01 exists for "zero vs. epsilon" on unbounded quantities; the QPX views carry q-values and posterior error probabilities living in [0,1], where it deletes the assertion outright - in one fixture 68 of 104 PEPs are <= 0.01, so every one of them would compare equal to every other. Verified, not argued: perturbing a PEP by 0.005 turns the psm reference red, and that is a change the shared absdiff would have absorbed silently. Both references were shown to fail on purpose - a 5% intensity change and the q-value change above - and restored afterwards. Fixtures were chosen by float-path length, not table size. ProteinQuantifier reads a committed consensusXML and does no mzML parsing, feature finding, alignment or normalization; IsobaricWorkflow adds only reporter extraction; both keys are float-free. ProteinQuantifier_19's 48 rows are 4 fraction groups x 6 TMT labels x 2 anchors with 12-entry grouped_runs lists - the design melting, fraction-group keying and label assignment that OpenMS#9869/OpenMS#9874/OpenMS#9876 touched - so it now VERIFIES rather than assumes OpenMS#9876's claim that nothing changes at the default 'fractions:aggregate'. The feature view and both ProteomicsLFQ producers are deliberately NOT pinned. The feature key contains a float32 'rt' matched with zero tolerance, and ProteomicsLFQ picks its median-normalization reference map by feature count, so one extra feature on one platform shifts every intensity by a finite factor. Those wait for the normalization fix that will move them anyway. Part of OpenMS#9864 Phase 0.1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx
…es 1-2) (#9879) * [TEST] QPX: pin values against text references, not just schema and row counts Phase 0.1 gave the QPX views a schema check and a row-count floor. Those catch a table that collapsed or lost a column; they say nothing about what is IN it. ParquetDiff gains 'out_tsv', which writes a table out as text sorted by primary key, and four references are pinned against that with FuzzyDiff: the pg view of ProteinQuantifier_19 (48 rows) and _18 (3 rows), and the pg (20 rows) and psm (4 rows) views of IsobaricWorkflow. Text rather than committed Parquet is the whole point. A binary reference can only ever be regenerated wholesale, which is exactly the operation that hides unrelated drift; a text reference is reviewable in a pull request and patchable line by line, and it puts QPX on the same footing as every other reference in the suite rather than inventing a second kind of artefact. The dump reuses the comparator's own canonical key encoding, so it cannot disagree with the comparison about what a primary key is, and it escapes tabs and newlines inside values so one row is always one line. Rows therefore come out in length-prefixed key order - 'TMT126' before 'TMT127C' before 'TMT131' - which looks unsorted but is deterministic and byte-comparable, which is what a reference needs. A file with no derivable key still dumps, in file order, with a warning saying so, because a reference built from it would be sensitive to how the producer ordered its rows. Comparison uses the shared relative tolerance with the absolute one set to ZERO. FuzzyDiff.ini's absdiff of 0.01 exists for "zero vs. epsilon" on unbounded quantities; the QPX views carry q-values and posterior error probabilities living in [0,1], where it deletes the assertion outright - in one fixture 68 of 104 PEPs are <= 0.01, so every one of them would compare equal to every other. Verified, not argued: perturbing a PEP by 0.005 turns the psm reference red, and that is a change the shared absdiff would have absorbed silently. Both references were shown to fail on purpose - a 5% intensity change and the q-value change above - and restored afterwards. Fixtures were chosen by float-path length, not table size. ProteinQuantifier reads a committed consensusXML and does no mzML parsing, feature finding, alignment or normalization; IsobaricWorkflow adds only reporter extraction; both keys are float-free. ProteinQuantifier_19's 48 rows are 4 fraction groups x 6 TMT labels x 2 anchors with 12-entry grouped_runs lists - the design melting, fraction-group keying and label assignment that #9869/#9874/#9876 touched - so it now VERIFIES rather than assumes #9876's claim that nothing changes at the default 'fractions:aggregate'. The feature view and both ProteomicsLFQ producers are deliberately NOT pinned. The feature key contains a float32 'rt' matched with zero tolerance, and ProteomicsLFQ picks its median-normalization reference map by feature count, so one extra feature on one platform shifts every intensity by a finite factor. Those wait for the normalization fix that will move them anyway. Part of #9864 Phase 0.1. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx * [FIX,TEST] Address review: escape the backslash, and make the row-floor test mean what it says Three findings from CodeRabbit on #9879, all valid. 1. dumpToTsv could forge an escape. A tab is rendered as the two characters '\' 't' to keep one row on one line - but a value that ALREADY contained a backslash followed by 't' rendered to those same two characters. Two genuinely different tables therefore produced identical text and the reference comparison accepted them as equal, which is the exact failure a value reference exists to rule out. The backslash is now escaped first and unconditionally. Verified in both directions rather than assumed: two tables differing only in 'literal backslash-t' versus 'a real tab' now render as X\\tY and X\tY, and with the fix reverted the new regression section fails on TEST_NOT_EQUAL(text_a, text_b) because both collapse to [X\tY]. The section also asserts that neither dump contains a raw tab, which would split a row. None of the four committed references contains a backslash, so none of them moves - checked, and all 51 QPX/ParquetDiff tests still pass against the unchanged files. 2. TOPP_ParquetDiff_8 passed for the wrong reason. It exists to show the row floor applies to the SECOND input, and it did fail - but its two fixtures have disjoint primary keys, so it would have failed on the key mismatch even if 'min_rows' never looked at 'in2' at all. 'schema_only' now removes every other failure cause, leaving the floor as the only thing that can go red. 3. The documented canonical key order was backwards, in both the CHANGELOG and the CMake comment. Length-prefixing puts the six-character 'TMT126' and 'TMT131' ahead of the seven-character 'TMT127C', not 'TMT127C' before 'TMT131'. Full local ctest unchanged at 2826 tests, 9 pre-existing environmental failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Y9DY9JfJasCr76qof5n5rx --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ExperimentalDesign's twoSample*mappings have the same signature and opposite key spaces, and the consumers of both resolve them the same way — so one of them throws for essentially every real design.The bug
getSampleToPrefractionationMapping()getSampleToConditionMapping()Both
getPathLabelTo*Mapping()consumers did:So the prefractionation one asks a name-keyed map for
"0"and throws a barestd::out_of_range— messagemap::at, naming neither the sample nor the design, and not deriving fromException::Baseso OpenMS error handling never sees it.It only works when the sample names are the stringified indices — which is exactly what
fromIdentifications()andfromConsensusMap()mint (sample_name = toStr(sample)). That is why nothing caught it: the paths OpenMS generates itself make name and index coincide, and every path where a human orsdrf-pipelinessupplies names breaks.Note that includes purely numeric names: sdrf-pipelines numbers samples from 1 while rows are 0-based, so
"1","2"never coincides with0,1either. Epifany's extended model reaches this path (#9864 §A5 — this is its root cause, and more precise than that issue's description).The fix
Both mappings are keyed by name, and both lookups go through it.
SampleSection::getSampleName()cannot supply the reverse — it readscontent_.at(row).at(columnname_to_columnindex_.at("Sample")), i.e. the Sample column of the content, which a section built withaddSample()or inferred from a map does not have. SosampleRowToName_()reverses the authoritativesample_to_rowindex_store instead.Two things found along the way:
getSampleToConditionMapping()branch ranfor (i = 0; i <= getNumberOfSamples(); ++i), reporting one sample more than the section holds, and fabricated keys"0".."N"that only mean anything under the wrong assumption. It now enumerates the actual samples.getNumberOfSamples()is documented// @return the number of samples measured (= highest sample index)but returns the row count. With zero-based samples those differ by one — and that comment is precisely how this class of bug gets written. Corrected.Breaking
getSampleToConditionMapping()'s keys change from stringified indices to names. It has no in-tree caller and no pyOpenMS binding, so the practical blast radius is the two consumers fixed here.Test
Builds two designs —
"1"/"2"(the sdrf-pipelines shape) and"BSA1"/"BSA2"— and asserts both mappings cover every sample by name, that neither reports a phantom extra sample, and that both per-(path,label)resolutions succeed.Verified it fails without the fix, for the right reason:
Full local ctest: 2800/2802, 8 failures, all pre-existing environmental (6
CometAdapterversion-string,PercolatorAdapternumerics,Doxygen_Warning_testHAVE_DOT) — identical to the baseline.Found while auditing the
sample/fraction_groupnumbering conventions for #9864. Independent of #9869; if that merges first this rebases cleanly apart from an adjacent test section.Second commit:
getSampleNameworks for both section shapesThe same root cause, one level down. A sample name lives in two places, and which is filled depends on how the section was built — a parsed design file fills the content table and a
"Sample"column; a section assembled withaddSample()(howfromConsensusMap()andfromIdentifications()build theirs) fills only the name→row store and pushes an empty content row.getSampleName()read only the column:so it threw
std::out_of_rangefor every inferred design, though the name sat insample_to_rowindex_the whole time.annotateColumnHeaders()worked around it by catching the throw and dropping the name.It now reads the column when there is one and falls back to the name→row store otherwise. A row present in neither raises
ElementNotFoundnaming the row and the section size, instead of a baremap::at.getSampleRow()gets the same treatment for an unknown name.Behaviour change worth reviewing: an inferred design now annotates a
sample_nameonto consensus-map headers where it previously annotated none, because the workaround no longer fires. No shipped reference moves — but that is a vacuous result, not a reassuring one: the only test reachingannotateColumnHeaderspasses-exp_design, i.e. a parsed design, which always had the column. That is precisely why the path was never covered, so both halves are now tested directly.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation
Tests