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

Abierto
#151 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python, yaml
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
11
Forks
11
Merge medio
1 d 16 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CAVISE/OpenCDA

Todos los issues de CAVISE/OpenCDA

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.