Skip to content

Commit

Permalink
FIX: failing lap accuracy checks caused all laps marked inaccurate
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Oct 19, 2023
1 parent 0f2b0a5 commit 871f013
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/changelog/v3.2.x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Bug Fixes
- Fix broken schedule backend 'f1timing' (failed to load 2023 season schedule
after Qatar GP due to unexpected data)

- Fix: failing lap accuracy check for one driver caused laps of all drivers to
be marked as inaccurate (#464)


New Features
^^^^^^^^^^^^
Expand Down
12 changes: 8 additions & 4 deletions fastf1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1929,11 +1929,15 @@ def _check_lap_accuracy(self):
prev_lap = lap

if len(is_accurate) > 0:
self._laps.loc[self.laps['DriverNumber'] == drv, 'IsAccurate'] = is_accurate
self._laps.loc[
self.laps['DriverNumber'] == drv, 'IsAccurate'
] = is_accurate
else:
_logger.warning("Failed to perform lap accuracy check - all "
"laps marked as inaccurate.")
self.laps['IsAccurate'] = False # default should be inaccurate
_logger.warning(f"Failed to perform lap accuracy check - all "
f"laps marked as inaccurate (driver {drv})")
self._laps.loc[
self.laps['DriverNumber'] == drv, 'IsAccurate'
] = False # default should be inaccurate

# necessary to explicitly cast to bool
self._laps[['IsAccurate']] \
Expand Down

0 comments on commit 871f013

Please sign in to comment.