Skip to content

Fix statistics timestamps for partially timed paths - #88

Open
bensynapse wants to merge 1 commit into
Sibyx:masterfrom
bensynapse:fix/available-stat-timestamps
Open

bensynapse wants to merge 1 commit into
Sibyx:masterfrom
bensynapse:fix/available-stat-timestamps

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

Fixes #51 on the stable master branch. Route and segment statistics now use the first and last non-null timestamps in point order. Track statistics take those timestamps from their segments, including when entire boundary segments are untimed.

Endpoint coordinates still describe the complete path. Duration, speed and pace keep their existing requirement for timestamps on the original endpoints: a partial time range cannot measure the duration of the whole path.

Added 22 PHPUnit cases covering missing boundary/interior timestamps, a single timestamp, entirely untimed paths, recorded order, recalculation and a multi-segment GPX XML round trip. Sixteen cases fail before the fix; all 22 pass afterward on PHP 7.3, 8.0 and 8.1 in Docker.

The full suite runs 70 tests with one existing failure on each of those PHP versions: SegmentParserTest::testToJSON compares floating-point JSON values exactly (for example, 2.9798324749548644 versus 2.979832475456357). Unchanged upstream has the same failure among its 48 tests. PHP CS Fixer passes for all four changed files with the project's .php-cs-fixer.php configuration, and composer archive succeeds.

This branch has not been deployed

No deployments
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.

startedAt and finishedAt values are not present if the first (or last) point is without timestamp

1 participant