[Feature]: Add annotation-based YAML parser for CoP and AdvCP configs

Aperta
#151 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à
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python, yaml
Ambito
backend

Direzione di ricerca

Start by locating the existing YAML parsing and default merging in coperception.visualization, coperception.metrics.metric_configs, and the AdvCP attack config. Read those call sites and compare the nested config fields named in the issue; completion means a reusable annotation-based parser supports the listed types and reports full config paths, with the three migration targets using it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

AdvCP CoP enhancement
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

Lingua principale
Python
Stelle
11
Fork
11
Merge medio
1g 16h
PR unite (30g)
12

Preparare l'ambiente

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 CAVISE/OpenCDA

Tutte le issue di CAVISE/OpenCDA

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.