-
-
Notifications
You must be signed in to change notification settings - Fork 273
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] DriverAhead not working properly #553
Comments
This may be due to another bug, which causes the lap alignment to be skipped for the Saudi Arabian race (see #549) |
@pesaventofilippo that's a good assumption, especially if this problem is not present in other races. I haven't investigated the problem here yet, though. In general, given the very short distances in the safety car train and the fairly low resolution source data, this may always be tricky. In case someone wants to try and fix #549, I'm happy to give some guidance. But the math behind that can make your head spin quite a bit 😅 |
@pesaventofilippo @theOehrly not sure but I checked Bahrain Grand Prix and got a bit of the issues. As example; Data is from lap 4 |
Uhm, I tried testing for HAM and PIA on lap 4, here's what I found: import fastf1
session = fastf1.get_session(2024, "Bahrain", "R")
session.load()
ham_lap = session.laps.pick_driver("HAM").pick_lap(4)
ham_car = ham_lap.get_car_data().add_driver_ahead()
pia_lap = session.laps.pick_driver("PIA").pick_lap(4)
pia_car = pia_lap.get_car_data().add_driver_ahead()
# Print all instances in which the DriverAhead for HAM isn't PIA (as it should be)
print(ham_car[ham_car.DriverAhead != "81"])
# Print all instances in which the DriverAhead for PIA isn't ALO (as it should be)
print(pia_car[pia_car.DriverAhead != "14"]) Output:
In both cases, the only instance in which the DriverAhead isn't correct is the first row in the lap data, where Maybe there's a problem in the way you determine the position during a lap? I could have missed something or maybe I'm not understanding, correct me if I'm wrong! |
@foxyskippy could you please share a code example to reproduce the problem? I took a bit more of an in depth look at this problem now. But I can't find anything wrong. The values that I get are different from yours, and they look correct. I have no idea why you get different results. But looking at the screenshot above, you seem to merge the data somehow? I won't dig into this any more unless you can show me how to reproduce the problem. Doing guess work is just a waste of time for everybody. My results match those of @pesaventofilippo. |
Describe the issue:
I noticed when Norris was leading behind safetycar Verstappen "overtook" several times Norris.
Reproduce the code example:
Error message:
No response
The text was updated successfully, but these errors were encountered: