mirror of
https://github.com/IAmTomShaw/f1-race-replay.git
synced 2026-05-10 00:08:35 +02:00
[PR #133] fix(core): Resolve Leaderboard Positioning Anomalies via Distance Metric Refactor #164
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/f1-race-replay#164
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/133
Author: @shash-hq
Created: 12/27/2025
Status: 🔄 Open
Base:
main← Head:fix/leaderboard-position📝 Commits (10+)
fcb3b48Fix: Leaderboard positions now use reliable FastF1 distance metricbece282Feat: Add Fastest Lap Sectors to Qualifying Leaderboardb21580eFix(data): Add error logging for missing sector data55affd9fix(deps): pin compatible dependencies for python 3.14b132a87fix(cli): use argparse and decouple library logic5872136refactor: extract duplicate weather processing logic918e6c5feat(cli): add global exception handling for better user experiencec6d5721fix(data): correctly accumulate race distance across lapsc73bd2afix(gui): log errors instead of silencing themf130fa1fix(core): Apply grid offset to leaderboard distance metric📊 Changes
6 files changed (+198 additions, -187 deletions)
View changed files
📝
main.py(+57 -40)📝
requirements.txt(+6 -5)📝
src/f1_data.py(+84 -108)📝
src/gui/race_selection.py(+4 -4)📝
src/interfaces/race_replay.py(+10 -20)📝
src/ui_components.py(+37 -10)📄 Description
Analysis of Issue
An investigation into the repository's
src/interfaces/race_replay.pyrevealed that the leaderboard sorting mechanism relied on a geometric projection of(x, y)coordinates onto a reference track line. This approach introduced significant inaccuracies:Additionally, the
src/f1_data.pydata ingestion pipeline failed to accumulateDistanceacross laps, resetting the metric to zero on each new lap, which necessitated the faulty projection logic.Implementation Details
Data Pipeline Fix (
src/f1_data.py):total_dist_so_farvariable within the telemetry processing loop.distfield now represents the true, monotonically increasing race distance fetched from FastF1.Leaderboard Logic Refactor (
src/interfaces/race_replay.py):_project_to_referencemethod for leaderboard sorting.driver_progresscalculation to utilize the verifieddisttelemetry field directly.Verification
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.