Repository navigation
temporal: restore strds.semantic_label band references for raster tools - #8063
Merged
Merged
Conversation
`t.rast.mapcalc`'s documented semantic-label band references (`inputs=strds.S2_8,strds.S2_4`) regressed on `main` and fail with: ``` ERROR: Space time dataset <strds.S2_8> of type <raster> not found ``` ### Why `_parse_id()` (added in OSGeo#7670) splits `name.semantic_label` only when `stds_type == "strds"`. But the call path is `t.rast.mapcalc` → `dataset_mapcalculator(..., "raster", ...)` → `open_old_stds(..., "raster")` → `_parse_id(stds_type="raster")`, so the `.label` is never split off. In 8.4 the split was unconditional, so it worked. ### Fix Accept the raster map element types (`"raster"`/`"rast"`) alongside `"strds"`, consistent with `try_get_stds()`, which already maps them to a raster STRDS. 3D-raster and vector STDS stay excluded (no semantic labels). Added doctests for `_parse_id` and registered `open_stds` in the temporal doctest suite. Minimal reproducer (fails before, passes after): ```sh r.mapcalc expression="nir = 100"; r.support map=nir semantic_label=S2_8 r.mapcalc expression="red = 50"; r.support map=red semantic_label=S2_4 t.create type=strds temporaltype=absolute output=test title=t description=t # register nir,red at 2020-01-01, then: t.rast.mapcalc inputs=test.S2_8,test.S2_4 output=ndvi basename=ndvi \ expression="float(test.S2_8 - test.S2_4) / (test.S2_8 + test.S2_4)" ``` Disclaimer: created with help of Claud But also tested it manually on my own dataset. With this fix, it works again.
ecodiv
requested review from
echoix and
petrasovaa
and removed request for
petrasovaa
October 13, 2026 10:51
petrasovaa
reviewed
Oct 14, 2026
petrasovaa
reviewed
Oct 14, 2026
petrasovaa
left a comment
Contributor
There was a problem hiding this comment.
Caught by AI review - since parse_id is also used in check_new_stds, one more suggestion to restore 8.4 behavior when user outputs a dataset name with a dot:
In check_new_stds, treat a non-None semantic label as an error:
name, mapset, semantic_label = _parse_id(name, stds_type=stds_type)
if semantic_label:
msgr.fatal(
_("Illegal dataset name <{}>. Character '.' not allowed.").format(name)
)
The message should quote the original full name, so capture it before the parse.
follows two suggestions from @petrasovaa - replaced doctest for pytest. The test file is named grass_temporal_semantic_label_test.py (made with Claud) - implemented the suggestion to treat a non-None semantic label as an error
Member
|
Sorry for breaking it and thanks for fixing. |
petrasovaa
reviewed
Oct 15, 2026
petrasovaa
approved these changes
Oct 15, 2026
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.
PR fixes #8062
t.rast.mapcalc's documented semantic-label band references (inputs=strds.S2_8,strds.S2_4) regressed onmainand fail with:The issue was with:
_parse_id()(added in #7670) splitsname.semantic_labelonly whenstds_type == "strds". But the call path ist.rast.mapcalc→dataset_mapcalculator(..., "raster", ...)→open_old_stds(..., "raster")→_parse_id(stds_type="raster"), so the.labelis never split off. In 8.4 the split was unconditional, so it worked.This can hopefully be fixed with:
Accept the raster map element types (
"raster"/"rast") alongside"strds", consistent withtry_get_stds(), which already maps them to a raster STRDS. 3D-raster and vector STDS stay excluded (no semantic labels).Added doctests for
_parse_idand registeredopen_stdsin the temporal doctest suite. Minimal reproducer (fails before, passes after):Disclaimer: created with help of Claud
But also tested it manually on my own dataset. With this fix, it works again.