Repository navigation
grass.temporal: Add registered_maps_grouped() and honor dbif mapsets in tlist() - #7714
Merged
Merged
Conversation
…in tlist() Add a gui_support helper that returns the maps registered in all space time datasets of the mapsets covered by the given database connection, grouped by dataset type and dataset id, ordered by start time. This gives the Data Catalog a cheap way to show dataset contents and to identify maps registered in any dataset without calling t.rast.list per dataset. Fix tlist() to iterate the mapsets of the passed connection instead of re-deriving the search path, so tlist_grouped() works with a connection created with mapsets=*. Default behavior is unchanged. The tests also cover mapsets without a temporal database, a project without any temporal database, and verify that listing with tgis.init(skip_db_init=True) does not create a temporal database. Written with the help of Claude Code.
ninsbl
reviewed
Jul 15, 2026
ninsbl
approved these changes
Jul 15, 2026
This was referenced Jul 16, 2026
wenzeslaus
added a commit
that referenced
this pull request
Jul 16, 2026
…7732) The temporal tests needs separate environment like all the other tests, but env can't be explicitly passes as for the rest of the API, so this uses pytest's monkeypatch to work around that. The module-scoped fixture created its sessions with gs.setup.init() without env, which sets the session up in the global os.environ. init() prepends the GRASS executable paths to PATH on every call and never removes them again, so PATH kept growing for the rest of the pytest process, and later tests which copy os.environ inherited it. On Windows this made r.coin fail on main since #7714 was merged: r.coin runs r.stats in a subprocess, and supposedly, cmd.exe could no longer resolve it on the inherited PATH, so r.coin reported an empty table. Create the sessions with env=os.environ.copy() instead. tgis reads the session from os.environ, so mirror the second session there with monkeypatch, which restores the environment once the module is done. This is what test_project_without_temporal_database in the same file already does. The ultimate fix is for tgis to accept env, which would remove the need for the monkey patch. Additionally, document the rule and the tgis exception in AGENTS.md. The investigation of the CI failure and this patch were done with the assistance of Claude Code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a helper to
grass.temporal.gui_supporthelpful for the Data Catalog STDS integration (#861, follow-up to #7608), where listing dataset contents with onet.rast.listcall per dataset is too slow.registered_maps_grouped(dbif=None): returns the maps registered in space time datasets, grouped by dataset type and dataset id, ordered by start time. One SQL query per mapset instead of one tool call per dataset.This also gives the caller the set of maps registered in any dataset (e.g., to hide or gray them out at the mapset level).
tlist()to iterate the mapsets of the passed connection instead of re-deriving the search path. Passing a connection created withmapsets="*"now works fortlist()/tlist_grouped(); behavior with the default connection is unchanged, so existing callers are unaffected.New pytest file covers temporal ordering (deliberately opposite to alphabetical order), relative time, maps in multiple datasets, cross-mapset registration, mapset scoping (search path, named mapsets,
*), and that listing withtgis.init(skip_db_init=True)does not create a temporal database as a side effect.Written with the help of Claude Code.
@saket0187, @ninsbl I am hoping this could be helpful for loading the maps quickly.