-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Restart lap times after the red flag #473
Comments
I want to remove the restart lap because I want to calculate the average pace of each driver excluding VSC, SC, Red flags, PitIn laps, PitOut laps. I think the TrackStatus in a restartlap should not be 1 (green flag) otherwise i do not know other way to remove the restart lap |
You can just remove the restart lap by its lap number. Something like :
(disclaimer: untested code) This is just normal pandas dataframe indexing to select all laps where the LapNumber is not 36. |
If the green flag is shown before the drivers cross the timing line (I'm going to check that this was actually the case) then the entirety of the 36th lap was under green flag conditions. Even though the restart procedure is included in that lap. |
Yes, but I am trying to do a code that works in any race, so the deleted lap should not be a constant
Yes, it was the case
I agree. I have reviewed the documentation and '1' indicates 'Track Clear' instead of 'Green Flag', maybe a new value can be added to indicate standing start in that lap, for example: ‘8’: Standing Start and the Track Status of the lap 36 should have been '81' or '18' or '181' Here I show the documentation about Track Status changes: Thanks! |
In fact, green flag indicates "track clear". So these two are equivalent.
No, because the restart procedure is not a track status. So this is technically incorrect. We would need to use a different way to indicate the restart. I understand that the data in its current form is not the most practical for you. But you will need to use a different approach for now. Either manually removing the lap. Or removing every lap after a red flag or something like that. |
Hi again, I have reviewed the data and determined how the information is obtained from it. I found that the "RaceControlMessages.jsonStream" contains information about whether the restart is a "standing start" or a "rolling start" after a red flag. Since I am only interested in removing the "standing start," I can search for it in the race control messages and remove lap+1 when the "standing start" is reported. Upon checking the documentation, I noticed that "fastf1.core.Session.race_control_messages" does not include the lap of the messages. Do you think it is possible to add the lap information to the messages in future versions? This information is written in https://livetiming.formula1.com/static/2023/2023-10-29_Mexico_City_Grand_Prix/2023-10-29_Race/RaceControlMessages.json
Thanks! |
Hi, i have just created the pull request #475 to add a new column called 'Lap' that contains the Lap information written in RaceControlMessages.jsonStream. I have tested it and it works, but it is my first pull request in github. I am not sure if I have done everything correctly Thanks |
I've investigated this part now as well. The "problem" is that lap times >=2:30.000 are intentionally ignored in the api parser to filter out some incorrect data. I guess that limit is chosen somewhat unfortunate here. Fixing this correctly (not just increasing the limit slightly) might be a bit more complicated but I'll try to look into that soon. |
This needs to be tackled when the API parser is rewritten (fairly high priority). Removing that 2:30 filter leads down a rabbit hole of properly handling a range of weird edge cases in the API that are really difficult to fix properly in the current implementation. |
Describe the issue:
Hi,
During the Mexican GP, a Red Flag was displayed on lap 34, prompting the drivers to return to the pit lane.
Lap 35 began when VER crossed the line and entered the pit lane, essentially becoming the "formation lap" behind the safety car.
Lap 36 began when VER crossed the line and then waited on the grid for the race to restart.
In lap 36, the LapTime is recorded as NaT for the first 5 drivers in that lap (VER, HAM, LEC, SAI, RIC), while the other drivers have LapTimes around 2 minutes and 20 seconds.
Given that the TrackStatus in Lap 36 is "1" (Green Flag), I am unable to filter the lap by TrackStatus, PitInTime, or PitOutTime. I believe this may be an inconsistency.
I hope it will be easy to undertsant and thank for your effort
Reproduce the code example:
Error message:
No response
The text was updated successfully, but these errors were encountered: