Skip to content

Empty track segment flips GPX.has_times() to True, blocking fill_time_data_with_regular_intervals - #299

Open
Str0k wants to merge 1 commit into
tkrajina:devfrom
Str0k:githubpower/t_1625c44b
Open

Str0k wants to merge 1 commit into
tkrajina:devfrom
Str0k:githubpower/t_1625c44b

Conversation

@Str0k

@Str0k Str0k commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

An empty track segment makes GPXTrack.has_times() return True even when every point in the track lacks a timestamp. Consequently, fill_time_data_with_regular_intervals(force=False) rejects a file that has no time data.

Restore AND aggregation across segments. An empty segment then remains neutral, as documented by GPXTrackSegment.has_times(). The change also restores the behavior before commit 81cb1eb. Three new unittest cases cover time availability, filling missing times, and a valid timed track; they are included in the repository's python -m unittest test entry point.

Validation against base df845044cc87ba6401e494a3a177ed007ff0f6eb:

Check Base Patch
New regression module 2 failed, 1 passed 3 passed
Native python -m unittest test 149 passed 152 passed
gpxinfo on repository fixtures Passed Passed
Strict Mypy 19 existing diagnostics Same 19; no additions

The regression and complete suites were reproduced in independent clean checkouts. The separate pytest adapter also passed after the patch; the native unittest counts above avoid its duplicate collection of imported tests.

AI assistance: implementation and independent code review used Hermes with self-hosted GLM 5.3. Automated validation was reproduced separately. This does not represent a human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant