Skip to content

ENH: populate Time and Position in SessionResults for practice sessions (issue #918)#929

Open
arpan2004 wants to merge 2 commits into
theOehrly:mainfrom
arpan2004:feature/fp-results-timing
Open

ENH: populate Time and Position in SessionResults for practice sessions (issue #918)#929
arpan2004 wants to merge 2 commits into
theOehrly:mainfrom
arpan2004:feature/fp-results-timing

Conversation

@arpan2004

@arpan2004 arpan2004 commented Jun 7, 2026

Copy link
Copy Markdown

Summary

Time column was NaT when fetching results for FP sessions. Populated Time column for FP sessions and sorted Position column by Time. Closes #918

Changes

  • Added _PRACTICE_LIKE_SESSIONS tuple constant to Session.__init__ (for both pre-2024 and 2024+ branches) containing 'Practice 1', 'Practice 2', 'Practice 3'
  • Added Session._calculate_practice_like_session_results() method that computes Time (each driver's best valid lap time) and Position (ranked by time) and writes them into session.results for practice sessions.
  • Called _calculate_practice_like_session_results() from Session.load() alongside existing qualifying and race result calculations
  • Updated SessionResults docstring: Position now mentions practice sessions; Time now distinguishes between race-like sessions (total race time) and practice sessions (best lap time)
  • Added test test_practice_session_results_time_and_position verifying Time and Position are populated and correctly ordered for a practice session
  • Added changelog entry to docs/changelog/current.rst

Usage

session = fastf1.get_session(2024, "Silverstone", "FP1")
session.load(telemetry = False, weather = False)

print(session.results[["Abbreviation", "Position", "Time"]])

Checklist

  • Code follows the project's coding conventions
  • Successfully populates Time and Position columns and sorts accordingly by best time

AI Disclosure

Claude Code was used as a coding assistant. The human author reviewed all AI-generated code and changes.

@arpan2004 arpan2004 changed the title ENH: populate Time and Position in SessionResults for practice sessions ENH: populate Time and Position in SessionResults for practice sessions (issue #918) Jun 7, 2026
@arpan2004 arpan2004 marked this pull request as draft June 18, 2026 00:52
@arpan2004 arpan2004 marked this pull request as ready for review June 18, 2026 00:52
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.

[ENH] FP Result time columns missing

1 participant