ENH: populate Time and Position in SessionResults for practice sessions (issue #918)#929
Open
arpan2004 wants to merge 2 commits into
Open
ENH: populate Time and Position in SessionResults for practice sessions (issue #918)#929arpan2004 wants to merge 2 commits into
arpan2004 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
_PRACTICE_LIKE_SESSIONStuple constant toSession.__init__(for both pre-2024 and 2024+ branches) containing'Practice 1', 'Practice 2', 'Practice 3'Session._calculate_practice_like_session_results()method that computesTime(each driver's best valid lap time) andPosition(ranked by time) and writes them intosession.resultsfor practice sessions._calculate_practice_like_session_results()fromSession.load()alongside existing qualifying and race result calculationsSessionResultsdocstring:Positionnow mentions practice sessions;Timenow distinguishes between race-like sessions (total race time) and practice sessions (best lap time)test_practice_session_results_time_and_positionverifyingTimeandPositionare populated and correctly ordered for a practice sessiondocs/changelog/current.rstUsage
Checklist
AI Disclosure
Claude Code was used as a coding assistant. The human author reviewed all AI-generated code and changes.