Problem or motivation
CoP and AdvCP YAML configs are currently parsed manually in several places using dict.get(...), local default merging, and ad-hoc validation helpers. This spreads schema knowledge across managers, visualizers, metrics, and attack helpers.
As configs grow, this makes it easier to miss invalid YAML, duplicate parsing logic, or produce unclear errors when a nested key is malformed.
Proposed solution
Add a reusable annotation-based YAML parser that loads YAML mappings into typed Python config objects, likely dataclasses, using Python type annotations as the schema source.
The parser should support:
- Nested typed config objects.
- Defaults and optional fields.
- Basic scalar coercion / validation for
int, float, bool, str.
- Lists, tuples, and mappings where needed.
- Clear validation errors with full config paths, e.g.
coperception.visualization.bbox_colors.pred.
Initial migration targets:
coperception.visualization
coperception.metrics.metric_configs
- AdvCP attack config, including mode, attacker ids, density, spoofing/removal parameters, and boxes.
Area
Cooperative perception
Problem or motivation
CoP and AdvCP YAML configs are currently parsed manually in several places using
dict.get(...), local default merging, and ad-hoc validation helpers. This spreads schema knowledge across managers, visualizers, metrics, and attack helpers.As configs grow, this makes it easier to miss invalid YAML, duplicate parsing logic, or produce unclear errors when a nested key is malformed.
Proposed solution
Add a reusable annotation-based YAML parser that loads YAML mappings into typed Python config objects, likely dataclasses, using Python type annotations as the schema source.
The parser should support:
int,float,bool,str.coperception.visualization.bbox_colors.pred.Initial migration targets:
coperception.visualizationcoperception.metrics.metric_configsArea
Cooperative perception