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

Aperta
#8,166 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
data

Direzione di ricerca

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.

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

Descrizione

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?

Lingua principale
C
Stelle
1.2k
Fork
447
Merge medio
2g 10h
PR unite (30g)
86

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

Tutte le issue di OSGeo/grass

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.