Open foxyskippy opened 3 months ago
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:
Date RPM ... DriverAhead DistanceToDriverAhead
0 2024-03-02 15:08:42.470 10410 ... NaN
Date RPM ... DriverAhead DistanceToDriverAhead
0 2024-03-02 15:08:41.910 10448 ... NaN
In both cases, the only instance in which the DriverAhead isn't correct is the first row in the lap data, where DriverAhead
is 0
(which is to be expected for the first row).
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!
I used Distance and RelativeDistance since DriverAhead is not giving proper info. As example Bahrain;
can it be the source of data (car, pos, interpolation)???
@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