v2.2.0

This release introduces a range of new features, bug fixes and improvements. While backwards compatibility has been kept in mind, some breaking changes are required.

Changes and New Features:

  • New fastf1.events.EventSchedule: The event schedule provides information about session start times, event format, name and location of upcoming events as well as previous event. The schedule data for the current season is pulled from an external source that is updated regularly. This should solve issues caused by schedule changes during the seasons or even during a race weekend.

  • New fastf1.events.Event: This object represents a single event and holds the same information as the event schedule, but for individual events.

  • New methods fastf1.get_testing_session(), fastf1.get_event(), fastf1.get_testing_event() and fastf1.get_event_schedule()

  • The cache now implements better automatic cache control and is used for all requests throughout FastF1.

  • The combination of improved caching and the implementation of the new event schedule now allow fastf1 to be used even if the Ergast API is not accessible. This improves reliability in case of temporary server or network problems.

  • Full offline support: Scripts can be run offline if they have been run at least once with an active internet connection and caching enabled.

  • Introduces the new objects fastf1.core.SessionResults and fastf1.core.DriverResult. These classes are built on top of pandas.DataFrame and pandas.Series. They provide information about all drivers that participated in a session. This information includes driver numbers, names, team names, finishing results, … Session results are available for all sessions supported by the Ergast database.

  • A hard coded list of drivers is no longer required for testing sessions. This data can now be pulled from the api as well.

  • A more understandable error will be raised if properties of the Session object are accessed which are not yet available because the relevant data has not been loaded.

Bug Fixes:

  • Fixed a bug that caused rain fall to always be true in weather data (#76)

Breaking Changes:

  • For testing events, fastf1.core.Session objects can no longer be created through fastf1.get_session(). You need to use fastf1.get_testing_session() instead.

  • fastf1.core.Session.date is now a pandas.Timestamp instead of a string.

  • The signature fastf1.core.Session.__init__(weekend, session_name) has been changed to fastf1.core.Session.__init__(event, session_name) to adhere to new naming conventions. This is a breaking change if the arguments are given as keyword arguments.

  • fastf1.get_session() may return a different session now for some edge cases, if you load sessions by name instead of by round number.

  • The property fastf1.core.Session.results is now an instance of fastf1.core.SessionResults instead of dict. Most of the previously available data is accessible through the new data replacement object. Some special information like GPS coordinates and altitude are no longer available though. If you think that this data should still be provided by FastF1 in the future, please open an issue for that.

  • The datatype of the telemetry ‘Brake’ data channel is changed from int to bool, as brake data was never actually more accurate than this. The representation as integer (percentage) values was misleading.

Deprecations:

(Objects, methods and attributes deprecated in v2.2 will be removed in v2.3. Until then, accessing them will still work but a FutureWarning is shown, reminding you of the deprecation.) Removal has been delayed for user convenience and because there exist no problems currently which make a removal immediately necessary. The new removal target is v3.0.0

  • fastf1.core.Weekend has been replaced with fastf1.events.Event. All previously available methods and properties are implemented by the replacement object, although they have been partially deprecated.

  • The attributes name, date and gp of fastf1.core.Weekend have been deprecated. The replacement object fastf1.events.Event subclasses pandas.Series. The standard ways for accessing pandas Series’ values should be used. The attributes have been additionally renamed in their Series representation. For example:

    • Weekend.name –> Event.EventName or Event['EventName']

    • Weekend.date –> Event.EventDate or Event['EventDate']

    • Weekend.gp –> Event.RoundNumber or Event['RoundNumber']

  • The attribute fastf1.core.Session.weekend has been replaced by fastf1.core.Session.event to adhere to new naming conventions.

  • The function fastf1.core.get_round() has been deprecated and will be removed without replacement in v2.3. Use fastf1.get_event() instead and and get the round number from the returned event object.

  • fastf1.core.Session.load_laps() has been deprecated. Use fastf1.core.Session.load() instead, which offers more flexibility for deciding which data should be loaded. The new method will no longer return a Laps object! You should access the Laps object through fastf1.core.Session.laps

  • fastf1.core.Driver has been replace with fastf1.core.DriverResult which has a different signature.

  • The attributes grid, position, name, familyname and team of fastf1.core.Driver have been deprecated. The replacement object fastf1.core.DriverResult subclasses pandas.Series. The standard ways for accessing pandas Series’ values should be used. The attributes have been additionally renamed in their Series representation. For example:

    • Driver.name –> DriverResult.FirstName or DriverResult['FirstName']

    • Driver.familyname –> DriverResult.LastName or DriverResult['LastName']

    • Driver.team –> DriverResult.TeamName or DriverResult['TeamName']

    • Driver.grid –> DriverResult.GridPosition or DriverResult['GridPosition']

    • Driver.position –> DriverResult.Position or DriverResult['Position']