Skip to content
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

Add pick_inlaps() and pick_outlaps() functions (from #453) #454

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

pesaventofilippo
Copy link
Contributor

No description provided.

@Casper-Guo
Copy link
Contributor

It's actually unexpected that we have laps with both a pit-in and a pit-out timestamp.

Top 3 tracks where this happen in the 2023 season;

Dutch Grand Prix         20
Australian Grand Prix    17
Japanese Grand Prix       9

I checked the track map at each one and the pit lane start and end are all on different sides of the start/finish line.

One explanation is that the car pitted on two consecutive laps but that is a rather rare occurrence that doesn't explain the frequency. Any other obvious reasons that I am overlooking?

@pesaventofilippo
Copy link
Contributor Author

pesaventofilippo commented Oct 5, 2023

One explanation is that the car pitted on two consecutive laps but that is a rather rare occurrence that doesn't explain the frequency. Any other obvious reasons that I am overlooking?

I think this mainly happens in Free Practice or Quali. In quali, a driver could be starting a lap but then aborts, so it re-enters the pit lane in the out lap.
In Free Practice sometimes drivers do an out-in lap to "prime" the rubber, or when doing a constant speed test with aero rakes on.

Not super common, but it happens sometimes

Edit: to answer your question, the first lap in a race always is an out lap. So for example, in the Dutch GP many drivers pitted at the end of lap 1, which becomes both an in lap and out lap.
Similar thing with the Australian GP, some drivers pitted on lap 1, but many also pitted on the penultimate lap (because of the SC? I can't remember)

@Casper-Guo
Copy link
Contributor

I forgot the first lap is always an out lap quirk. That could explain why the tracks where this happens change from year to year.

FWIW I only looked at laps from the actual races

@theOehrly
Copy link
Owner

I manually looked at some of the laps that are both an inlap and an outlap in a race. Apart from the first lap, this seems to always happen around safety cars, red flags and changing weather conditions and seems reasonable.

For the first lap, actually, I think that it should have no PitOutTime except when a car starts from the pit lane. But that's a separate problem. I wouldn't try to handle the first lap separately in this new function. I think PitOutTimes should be removed from the first lap instead.

The PR looks good. If you agree that first lap should have no PitOutTime, then I'll merge this.

@pesaventofilippo
Copy link
Contributor Author

If you agree that first lap should have no PitOutTime, then I'll merge this.

Yeah, I agree with you. Like you said, it would make sense to only have PitOutTime for a first lap if a car starts from the pit lane. But this is possibly a more complex fix, we should maybe open a new issue for that and gather ideas?

@theOehrly theOehrly merged commit 97c4ec8 into theOehrly:master Oct 9, 2023
@theOehrly
Copy link
Owner

I opened #461 to keep a reminder that the PitOutTime for first laps in a race should not exist

@pesaventofilippo pesaventofilippo deleted the patch-1 branch October 9, 2023 19:54
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.

3 participants