[Feat] temporal: simplify usage with an open method or function
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
- 35/100
Direzione di ricerca
Start by reading the temporal framework documentation and the open_stds module, especially _open_old_stds, _open_new_stds, and _check_open_new_. Review the linked draft pull request for context on the proposed API. Done means a replacement covers space time datasets and map datasets, handles setup and compatibility checks, and documents the recommended usage.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
Using the temporal framework appears to be relatively complicated for users. It requires them to initialize TGIS, maybe create a database and database interface, check the dataset input (id) to be qualified, ...
Describe the solution you'd like
I would like to have an open method for SpaceTimeDatasets that simplifies the usage of the temporal framework. Opening should not require users to do several things in the right order and execute several checks, unless they have specific requirements themselfs.
Furthermore, I would want it to be more similar to what people are used to in Python otherwise, including context manager. Thus, I would like to propose a file-like open method or function for SpaceTimeDatasets.
Here is how a file-like open function may look like:
import grass.temporal as tgis
stds = tgis.open(
"my_series@my_mapset",
"w",
stds_type="stvds",
**{
"title": "stds_title",
"description": "stds description",
"temporal_type": "absolute"
}
)
stds = tgis.open("my_series@my_mapset", "r", stds_type="stvds")
stds = tgis.open("my_series@my_mapset", "r+", stds_type="stvds")
# or
with tgis.open("my_series@my_mapset", "r", stds_type="stvds") as input_stds:
input.stds.get_registered_maps()
The idea is that it also sets up stuff for the user if needed and that it also execute reasonable checks (like does the TGIS DB exist, does the STDS exist, is it compatible with the open request (writeable, appropriate temporal type, ...).
Describe alternatives you've considered
An alternative would be to have a class / instance method like e.g. for vector or raster in pygrass:
import grass.temporal as tgis
# Create or modify a dataset
stds = SpaceTimeVectorDataset("my_series@my_mapset")
mode = "r+" if stds.exists() else "w"
with stds.open(
mode,
**{
"title": "stds_title",
"description": "stds description",
"temporal_type": "absolute"
}
) as stds:
stds.get_registered_maps()
Additional context
The temporal framework already offers several different ways to create or open space time datasets, while the documentation is not clear what is "best-practice". The new functionality should replace the content in the open_stds module (open_old_stds, open_new_stds, check_open_new). The new implementation has to cover also map datasets to be a full replacement.
The database interface would be dataset specific, if not provided as keyword argument, and gets closed when the dataset object is destroyed.
I have an AI assisted draft implementation here: https://github.com/ninsbl/grass/pull/56 and would be happy about any feedback, but esp. about the suggested alternatives, before I make a more comprehensive implementation plan.
- Lingua principale
- C
- Stelle
- 1.2k
- Fork
- 447
- Merge medio
- 2g 10h
- PR unite (30g)
- 86
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di OSGeo/grass
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] v.db.addtable expands $MAP only when it is a directoryForse già presa @alteralto l’ha presa 35 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] grass.pygrass: Cats.delete(0) deletes all layer categories instead of category 0Forse già presa @Mohit-Ak l’ha presa 40 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] macOS: Startup crashes with StopIteration when ~/Documents is not readable (macOS privacy protection)Forse già presa @NIne-WIngEd l’ha presa 46 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OSGeo/grass#8027 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Specify the test project nameForse già presa @Om23131212 l’ha presa 39 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
OSGeo/grass#7860 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
Revivedx/SavageWindRecomp#1358 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
ossc-db/pg_hint_plan#255 ·
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
awslabs/aws-c-common#1319 ·
-
editor/integration
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
DeusData/codebase-memory-mcp#3130 ·
I maintainer di solito rispondono entro 1 giorno