Skip to content

Commit

Permalink
MNT: change DeprecationWarning to FutureWarning (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
theOehrly committed Feb 19, 2024
1 parent b7fe807 commit ed4f851
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions fastf1/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3060,18 +3060,17 @@ def pick_fastest(self, only_by_time: bool = False) -> "Lap":
laps = self.loc[self['IsPersonalBest'] == True] # noqa: E712

if not laps.size:
warnings.warn(("None will be returned instead of an empty Lap "
"object when there are no laps that satisfies "
"the definition for fastest lap starting from "
"version 3.3"),
DeprecationWarning)
warnings.warn(("In the future, `None` will be returned instead of "
"an empty `Lap` object when there are no laps that "
"satisfy the definition for fastest lap."),
FutureWarning)
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 starting from version 3.3"),
DeprecationWarning)
warnings.warn(("In the future, `None` will be returned instead of "
"an empty `Lap` object when there is no recorded "
"LapTime for any lap."),
FutureWarning)
return Lap(index=self.columns, dtype=object).__finalize__(self)

lap = laps.loc[laps['LapTime'].idxmin()]
Expand Down

0 comments on commit ed4f851

Please sign in to comment.