[Feat] grass.temporal: share one id helper between maps and space-time datasets

Abierto
#8,166 1 comentario 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
data

Línea de trabajo

Start by reading AbstractMapDataset.build_id() and split_name(), then locate the 17 duplicated id expressions across the nine grass.temporal and t.* files mentioned in the issue. Move the helpers to grass.temporal.utils, retain the map class methods as wrappers, and update the copies. The issue leaves open whether _parse_id() belongs there, so clarify that design choice before considering the refactor complete.

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

Descripción

Is your feature request related to a problem? Please describe.

@ninsbl suggested on #7739 a public helper for STDS ids, maybe in a temporal utils module. Looking into it, x if x.find("@") >= 0 else x + "@" + mapset is copied 17 times across 9 files in grass.temporal and the t.* tools. AbstractMapDataset.build_id(x, mapset) already does the same thing (I checked it gives the same id for name, name@mapset, name.label and name:layer), but it sits on the map class, and 14 of the 17 copies are for space-time datasets.

Describe the solution you'd like

Move split_name() and build_id() to a new grass.temporal.utils as plain functions, keep the AbstractMapDataset methods as wrappers, and switch the copies over.

Describe alternatives you've considered

Calling AbstractMapDataset.build_id() from the space-time dataset code as it is. That works, it just reads a bit odd.

Additional context

Does this match what you had in mind? And should _parse_id() from open_stds.py go there too, or stay where it is because of the semantic labels?

Lenguaje dominante
C
Estrellas
1.2k
Forks
447
Merge medio
2 d 10 h
PR fusionados (30 d)
86

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 OSGeo/grass

Todos los issues de OSGeo/grass

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.