[PR #161] Add tire life tracking and display in telemetry and leaderboard #185

Open
opened 2026-05-07 00:19:06 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/IAmTomShaw/f1-race-replay/pull/161
Author: @KoenvanWijlick
Created: 1/9/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • e8d3a95 Add tire life tracking and display in telemetry and leaderboard

📊 Changes

3 files changed (+63 additions, -21 deletions)

View changed files

📝 src/f1_data.py (+25 -15)
📝 src/interfaces/race_replay.py (+16 -2)
📝 src/ui_components.py (+22 -4)

📄 Description

Tire Life Tracking in Race Replay

Summary

Adds tire life tracking and display to the race replay, showing tire age for each driver in the leaderboard component. Tire data is now collected from the FastF1 API, processed through the telemetry pipeline, and displayed alongside each driver's tire compound indicator.

Changes

Data Collection (src/f1_data.py)

  • Extract TyreLife data from lap telemetry (represents actual tire age in laps)
  • Add tyre_life_all array to store tire life values per telemetry point
  • Include tire life in the resampling process to maintain data consistency across all frames
  • Add tyre_life field to the frame data structure for each driver

UI Display (src/ui_components.py)

  • Display tire age in L{age} format in the leaderboard (e.g., L5 for 5 laps on current tires)
  • Position tire age text to the left of the tire compound icon
  • Calculate tire age as tyre_life - 1
    (TyreLife represents the lap being driven, not laps completed)
  • Use white, bold text for improved visibility

Race Replay Integration (src/interfaces/race_replay.py)

  • Process tire life data from frame data
  • Calculate tire age for each driver at each frame
  • Pass tire age information to the leaderboard component

Visual Example

The leaderboard now displays:

[Position] [Driver Code] L5 [DRS DOT] [Tire Icon] [Gap]

Where L5 indicates the driver has completed 5 laps on their current set of tires.

Technical Notes

  • Tire age calculation correctly handles pre-race tire usage (data sourced directly from the FastF1 API)
  • Defaults to 0 laps if tire life data is unavailable
  • Debug logging added for the first frame to verify data correctness

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/IAmTomShaw/f1-race-replay/pull/161 **Author:** [@KoenvanWijlick](https://github.com/KoenvanWijlick) **Created:** 1/9/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`e8d3a95`](https://github.com/IAmTomShaw/f1-race-replay/commit/e8d3a95f29a736b2626fcbea427561477fc82fb0) Add tire life tracking and display in telemetry and leaderboard ### 📊 Changes **3 files changed** (+63 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/f1_data.py` (+25 -15) 📝 `src/interfaces/race_replay.py` (+16 -2) 📝 `src/ui_components.py` (+22 -4) </details> ### 📄 Description # Tire Life Tracking in Race Replay ## Summary Adds tire life tracking and display to the race replay, showing tire age for each driver in the leaderboard component. Tire data is now collected from the FastF1 API, processed through the telemetry pipeline, and displayed alongside each driver's tire compound indicator. ## Changes ### Data Collection (`src/f1_data.py`) - Extract `TyreLife` data from lap telemetry (represents actual tire age in laps) - Add `tyre_life_all` array to store tire life values per telemetry point - Include tire life in the resampling process to maintain data consistency across all frames - Add `tyre_life` field to the frame data structure for each driver ### UI Display (`src/ui_components.py`) - Display tire age in **`L{age}`** format in the leaderboard (e.g., `L5` for 5 laps on current tires) - Position tire age text to the left of the tire compound icon - Calculate tire age as `tyre_life - 1` (`TyreLife` represents the lap being driven, not laps completed) - Use white, bold text for improved visibility ### Race Replay Integration (`src/interfaces/race_replay.py`) - Process tire life data from frame data - Calculate tire age for each driver at each frame - Pass tire age information to the leaderboard component ## Visual Example The leaderboard now displays: ``` [Position] [Driver Code] L5 [DRS DOT] [Tire Icon] [Gap] ``` Where `L5` indicates the driver has completed 5 laps on their current set of tires. ## Technical Notes - Tire age calculation correctly handles pre-race tire usage (data sourced directly from the FastF1 API) - Defaults to `0` laps if tire life data is unavailable - Debug logging added for the first frame to verify data correctness --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/f1-race-replay#185
No description provided.