Skip to content

Name the out-of-order times in the Interpolator's error - #850

Merged
caglarpir merged 1 commit into
mapillary:mainfrom
caglarpir:fix-interpolator-error-message
Oct 20, 2026
Merged

caglarpir merged 1 commit into
mapillary:mainfrom
caglarpir:fix-interpolator-error-message

Conversation

@caglarpir

Copy link
Copy Markdown
Contributor

geo.Interpolator raised its "points must be sorted" ValueError from a string without the f prefix, so the message showed the placeholders instead of the times:

ValueError: Expect points to be sorted by time, but got {left.time} then {right.time}

It came up when distance sampling was handed GPX tracks out of time order in #841, which now sorts them. This fixes the message itself.

Adds a test that the message names the times; it fails without the fix. Unit tests, mypy, ruff and usort pass.

The message lacked its f prefix, so it read "but got {left.time} then
{right.time}" instead of the times that were out of order. It came up
when distance sampling was handed GPX tracks out of time order.
@meta-cla meta-cla Bot added the cla signed label Oct 19, 2026
@caglarpir
caglarpir merged commit f296d77 into mapillary:main Oct 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant