Skip to content

Commit

Permalink
fix crash in calculate_driver_ahead (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Apr 8, 2022
1 parent 8d3e2de commit 4846014
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ Changelog
=========


v0.2.3
======

Bug Fixes:

- Fixed crash in :func:`fastf1.Telemetry.calculate_driver_ahead` in case
of missing car data (#146)


v2.2.2
======

Expand Down
2 changes: 2 additions & 0 deletions fastf1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,8 @@ def calculate_driver_ahead(self):
first_lap_number = (own_laps[own_laps['LapStartTime'] <= t_start])['LapNumber'].iloc[-1]

for drv in self.session.drivers:
if drv not in self.session.car_data:
continue
# find correct first relevant lap; very important for correct zero point in distance
drv_laps = self.session.laps[self.session.laps['DriverNumber'] == drv]
if drv_laps.empty: # Only include drivers who participated in this session
Expand Down
2 changes: 1 addition & 1 deletion fastf1/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.2.2'
__version__ = '2.2.3'

0 comments on commit 4846014

Please sign in to comment.