Skip to content

temporal: add _readonly property to STDS and prohibit writing metadata for _readonly - #7739

Open
ninsbl wants to merge 7 commits into
OSGeo:mainfrom
ninsbl:temporal_ro
Open

ninsbl wants to merge 7 commits into
OSGeo:mainfrom
ninsbl:temporal_ro

Conversation

@ninsbl

@ninsbl ninsbl commented Jul 17, 2026

Copy link
Copy Markdown
Member

This PR makes sure the temporal framework does not write file metadata to the source mapset of map from another mapset and that it does not write "ghost" metadata for that map in the current mapset (the C-tools should write to current anyway).

The readonly property may become useful in other contexts as well (see e.g.: #2448).

Fixes: #3394
Replaces: #7211

@github-actions github-actions Bot added Python Related code is in Python libraries tests Related to Test Suite labels Jul 17, 2026
Comment thread python/grass/temporal/base.py Outdated
if "@" in ident:
name, mapset = ident.split("@", 1)
if ":" in name:
name, layer = ident.split(":", 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name, layer = ident.split(":", 1)
name, layer = name.split(":", 1)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I feel I read this pattern (or variations of it) a bit too often. In #7670 I added a private function in open_stds.py to parse components of a STDS ID string. I wonder if such a function could / should go into e.g. an utils module or core.py to not repeat this splitting many places...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing semantic_label or timestamp should probably be guarded too...

@echoix

echoix commented Sep 30, 2026

Copy link
Copy Markdown
Member

What’s missing here to be done?

@ninsbl

ninsbl commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

What’s missing here to be done?

I was considering having something like this:

as a public function e.g. in temporal.utils because this code seems repeated several places: https://github.com/search?q=repo%3AOSGeo%2Fgrass+find%28%22%40%22%29&type=code ... what du you think, better suited in a separate PR?

@ninsbl

ninsbl commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

A helper function for STDS id parsing is better suited for a separate PR. This should be good to go...

@ninsbl
ninsbl enabled auto-merge (squash) October 30, 2026 20:32
@ninsbl
ninsbl disabled auto-merge October 30, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libraries Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] t.register: registering vector maps from other mapsets writes cruft in the current mapset

3 participants