Skip to content

grass.temporal: Fix end time parsing when registering relative-time maps from file (t.register) - #7717

Merged
petrasovaa merged 1 commit into
OSGeo:mainfrom
petrasovaa:t-register-relative-end-time
Jul 15, 2026
Merged

petrasovaa merged 1 commit into
OSGeo:mainfrom
petrasovaa:t-register-relative-end-time

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

Registering maps into a relative-time dataset with the documented name|start|end file format silently produced wrong results:

printf 'a|0|1\nb|1|2\n' > maps.txt
t.register type=raster input=test file=maps.txt unit=days
t.rast.list input=test columns=name,start_time,end_time,semantic_label
a|0|None|1
b|1|None|2

The end times were dropped (maps registered as point time instead of intervals) and were instead written as semantic labels — including into the raster metadata in the spatial database, where they persist even after t.remove.

The cause is the three-column disambiguation in register_maps_in_space_time_dataset(): the last column is treated as an end
time only when it parses as a datetime, which can never happen for relative time, so the semantic label branch was unconditional for relative datasets. This is a regression from the band references implementation (a83af32); the input file format documentation still describes the original behavior.

Changes:

  • An integer third column is now interpreted as an end time for relative-time datasets; a non-integer remains a semantic label. Absolute-time behavior is unchanged.
  • New pytest tests for registering from a file (interval, semantic label, increment, no-dataset, and failure cases for both temporal types).
  • Removed test.t.register.raster.file.reltime.sh, an assertion-less relic of the pre-gunittest shell framework that is not executed by any harness; its cases are covered by the new tests.
  • Documented how the last column is disambiguated in the semantic labels section of the manual.

Written with the help of Claude Code.

…aps from file (t.register)

The name|start|end input file format silently misread the end time as a
semantic label for relative-time datasets: maps were registered as point
time and the intended end times were written as semantic labels into the
raster metadata. Regression from the band references implementation
(a83af32). An integer third column is now interpreted as an end time
for relative time; anything else remains a semantic label.

Written with the help of Claude Code.
@petrasovaa petrasovaa added bug Something isn't working errata Include in errata (fixes wrongly computed results) labels Jul 14, 2026
@github-actions github-actions Bot added temporal Related to temporal data processing Python Related code is in Python HTML Related code is in HTML libraries module docs markdown Related to markdown, markdown files tests Related to Test Suite labels Jul 15, 2026
@petrasovaa
petrasovaa merged commit e193ca7 into OSGeo:main Jul 15, 2026
26 checks passed
@petrasovaa
petrasovaa deleted the t-register-relative-end-time branch July 15, 2026 07:49
@github-actions github-actions Bot added this to the 8.6.0 milestone Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working docs errata Include in errata (fixes wrongly computed results) HTML Related code is in HTML libraries markdown Related to markdown, markdown files module Python Related code is in Python temporal Related to temporal data processing tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants