Extend configurable params for std-container types#15525
Merged
Conversation
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
Please consider the following formatting changes to AliceO2Group#15525
…parseSet
Follow-up hardening on top of the std-container ConfigurableParam support.
1. split() no longer silently drops empty fields. A stray delimiter such as
"[1,,3]" previously parsed to a 2-element vector with no error, and "key:"
collapsed an empty map value away. Both now produce an empty token that is
rejected by parseScalar / the map-syntax check, so malformed configuration
surfaces as an error instead of corrupting element counts. The empty
container case ("[]" / "{}") is still short-circuited by the callers before
split() runs, so well-formed input is unaffected.
2. Removed the redundant parseSet() branch (and the now-unused HasPushBack
concept). Every non-map Container already satisfies SequenceContainer, so the
parseSet dispatch was reached for all sequence and set types and re-parsed the
string into a throwaway std::vector before copying element-by-element.
parseSequence inserts at end(), which std::set / std::unordered_set accept
just as well, so all non-map containers now share a single, single-pass path.
3. Re-enabled cleanup of test_config.root in ConfigurableParam_Container_FileIO_ROOT
(the std::remove was left commented out), restoring test isolation.
Adds regression tests: set/unordered_set/list/deque parsing through the unified
parseSequence path (incl. set de-duplication), and rejection of empty tokens in
both sequence and map parsing.
Note: container parse failures remain non-fatal (logged), matching the existing
scalar setValue behaviour; this commit does not change that contract.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
|
Very nice development. Maybe you could take quick look at suggested improvements from Claude code via PR to your branch. But we can also discard it if you think the findings are not relevant. Just let me know. |
ConfigurableParam: reject malformed container fields, drop redundant parseSet
Collaborator
Author
|
Ha indeed thanks, claude trimmed the parsing logic nicely! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for std container types (not nested, see ConfigurableParamTest.h) and on failure to parse offers suggestions for closest matching setting via Damerau-Levenshtein metric: