theOehrly / Fast-F1

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
https://docs.fastf1.dev
MIT License
2.54k stars 264 forks source link

[BUG] Monaco 2024 Race is missing the first lap #594

Closed formulatimer closed 5 months ago

formulatimer commented 5 months ago

Maintainer edit: the issue description below, while accurate, only describes the effect of a bigger problem.

Describe the issue:

The LapStartTime of the first lap of LEC in the race of Monaco 2024 is 0 days 01:35:54.733000 with concordates with SAI, NOR, PIA. However TSU first lap LapStartTime is 0 days 00:55:05.680000 and secondo lap.

There shloud be an error

Reproduce the code example:

session = ff1.get_session(year, grand_prix, session)
session.load(laps=True, telemetry=False, weather=False, messages=True, livedata=None)

laps=session.laps

Error message:

No response

theOehrly commented 5 months ago

I've investigated this and there is actually a bigger problem here. The whole first lap is missing in the data. What is labeled as lap number 1 is actually the second lap already. The root problem for FastF1 is that the source data only shows the first lap as ending after the red flag. FastF1 usually only considers timing data as valid starting 5 minutes before the end of the first lap. This means that relevant parts of the data are discarded because the first lap is more than half an hour long in the data (and therefore far above that limit). This in turn causes the lap to be ignored entirely. The effects described in the original issue report seem to just be a side effect of this.

While I have found the root cause for this problem, I'm not sure yet how to best fix it without risking breaking other things.

formulatimer commented 5 months ago

Maybe the first lap can be determined by RaceControlMessages

theOehrly commented 5 months ago

Fixed, please update to the latest version.