Skip to content

Commit

Permalink
Add deprecation warnings, handle uncaught error
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper-Guo committed Nov 9, 2023
1 parent aca8230 commit 251bcee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fastf1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2854,16 +2854,16 @@ def pick_fastest(self, only_by_time: bool = False) -> "Lap":

if not laps.size:
warnings.warn(("None will be returned instead of an empty Lap "
"object when there are no laps with "
"IsPersonalBest=True starting from version 3.3"),
"object when there are no laps that satisfies "
"the definition for fastest lap starting from "
"version 3.3"),
DeprecationWarning)
return Lap(index=self.columns, dtype=object).__finalize__(self)

if laps['LapTime'].isna().all():
warnings.warn(("None will be returned instead of an empty Lap "
"object when there is no recorded LapTime for "
"any lap with IsPersonalBest=True starting from "
" version 3.3"),
"any lap starting from version 3.3"),
DeprecationWarning)
return Lap(index=self.columns, dtype=object).__finalize__(self)

Expand Down

0 comments on commit 251bcee

Please sign in to comment.