Changelog

v2.3.0

Bug Fixes:

New Features:

Changes:

  • The default base url scheme for Ergast is changed from http to https.

Deprecations and Notices for Upcoming Changes:

  • Deprecation: Undocumented function fastf1.ergast.fetch_weekend() will be removed without a direct replacement in a future version (target: v3.0.0).

  • Change: fastf1.utils.to_timedelta() and fastf1.utils.to_datetime() will return NaT instead of raising and exception if a valued cannot be parsed in a future version (target: v3.0.0).

v2.2.9

Bug Fixes:

v2.2.8

Bug Fixes:

  • Ensure that fastf1.core.Session.drivers returns a list of unique values. This prevents problems that result from drivers being incorrectly listed multiple times in the session result information. (see #182 for example)

v2.2.7

Bug Fixes:

  • Fixed an issue that prevented merging of car data and position data in some cases (see #180)

v2.2.6

Bug Fixes:

  • Fixed incorrect lap start times for first lap after a red flag restart

  • Fixed first lap missing if a driver crashed during the first lap of a sprint race (#175)

  • Fixed headshot url missing from result of fastf1.api.driver_info() (by @bruzie in #173)

New Features:

  • Added a check detect and to remove incorrect lap times in the api parser (#167)

v2.2.5

Bug Fixes:

  • Fixed grid position, position and points missing from Sprint sessions result in 2022 (#166)

New Features:

v2.2.4

Bug Fixes:

  • compatibility fixes for supporting ‘Sprint’ sessions for the 2022 season (see also #160)

v2.2.3

Bug Fixes:

  • Fixed crash in fastf1.Telemetry.calculate_driver_ahead() in case of missing car data (#146)

v2.2.2

Changes:

  • Implement support for reading information about a drivers personal best lap from the api. pick_fastest() will now by default return the quickest lap that is also marked as personal best lap of any driver. This fixes the long standing problem that the fastest lap returned by this function may actually be a deleted lap.

Bug Fixes:

  • Fixed: data for the 2022 Saudi Arabian Grand Prix can not be loaded (#135)

  • Fixed: incorrect python version check in live timing client, that prevented running on actually supported versions of python (#132)

v2.2.1

Changes:

  • Log ergast error tracebacks on level DEBUG instead of WARNING to avoid confusion when a failure was to be expected.

Bug Fixes:

  • Fixed: no session results for Verstappen (driver number 1 vs 33) (by @vlesierse)

  • Fixed: slicing telemetry by using multiple laps as a reference returns no data if some laps have NaT values for ‘Time’ or ‘LapStartTime’

  • Fixed regression: Loading of livetiming no longer possible since v2.2.0 if recording does not contain a driver list

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']

v2.1.13 More Bug Fixes

  • fixed issue #74: don’t assume that a further session status change (e.g. ended, finalized) exists after the last lap

  • improved error handling if there exists no usable lap data for any driver (#73, e.g. Imola 2021 FP1)

  • fastf1.core.get_session() should not quietly return fastf1.core.Weekend instead of fastf1.core.Session if an invalid event name is given.

v2.1.12 Fixes and Patches

v2.1.11 Fixes and Patches

  • Fix: last inlap missing from Laps

  • Add schedule patch for Sprint Race Weekend at Brazil GP

v2.1.10 Ergast compatibility

  • introduce a custom user agent to identify FastF1 when requesting data from the Ergast API

v2.1.9 General maintenance

  • switch renamed dependency ‘fuzzywuzzy’ to new name ‘thefuzz’

  • add support for getting team colors from incomplete or partial team names or from team names containing typos or extra words

  • make fuzzy string matching for event names case-insensitive

  • set missing lap start times to pit out time where possible (fixes issue #29),

  • add new api function fastf1.api.driver_info()

  • support incomplete laps (not timed) caused by drivers crashing/retiring during a lap: infer as much information as possible so that telemetry can be accessed easily (fixes issues #36 and #41)

v2.1.8 Add temporary support for sprint qualifying

  • This release adds a temporary patch to support weekends with sprint sprint qualifying and their changed order of sessions. To get data for sprint qualifying, you can use the fastf1.get_session function with the argument event='SQ'. Also remember that FP2 is on a Saturday on these weekends. FP3 does not exist.

v2.1.7 Various bug fixes

  • fix crash when loading cached data after dependencies have been updated

  • specify minimum versions for pandas and numpy

  • fix incorrect Alpine team name

  • fix future warnings and deprecation warnings caused by Pandas 1.3.0

v2.1.6 Added weather data, general improvements and bug fixes

v2.1.5 Improved robustness and minor fixes

v2.1.4 Bug fixes and various minor improvements

  • Fix a bug introduced in v2.1.3 which prevented the loading of any data from the api

  • Make the api parser more robust and tolerant against invalid data

  • various small improvements

v2.1.3 Improved error handling

Added error handling for partially invalid data when loading car data and position data.

v2.1.2 Hotfixes for loading live timing data

  • Fix failure to load live timing data due to an error in the api cache function wrapper.

  • Improve track status loading

v2.1.1 Add support for recording and using live timing data

  • Possibly breaking changes:

    • fastf1.Session.load_laps(): Data will now be loaded without telemetry by default, i.e. only timing data is loaded. Telemetry data is usually not available anyways, therefore this prevents a confusing error.

  • Changes:

    • Possibility to record live timing data

    • Possibility to use recorded live timing data as a data source

v2.1: Refactoring, accuracy improvements and a more accessible interface

  • Possibly breaking changes:

    • The ‘Space’ column has been renamed to ‘Distance’ as this makes more sense

    • fastf1.utils.delta_time() now returns two values; see explanation in the documentation

    • Lap telemetry is no longer precalculated and no longer saved in a separate column of the Laps DataFrame. This telemetry is now a computed property of Laps and Lap

      • calculated property .telemetry: This contains position and car data merged into one instance of Telemetry (instance of DataFrame). The data is comparable to the previous ‘telemetry’ column. This data is intended for easy plotting. It should not be used for any further calculations as it contains interpolated values.

        laps = session.load_laps()
        fastest = laps.pick_fastest()
        
        tel = fastest['telemetry']  # will now fail as telemetry is no longer saved in DataFrame/Series
        tel = fastest.telemetry  # will (still) work as this now accesses the computed property
        
      • function get_car_data, get_pos_data: These functions are available for Lap and Laps. They return the telemetry data as received from the api with minimal postprocessing and crucially unmerged and without any interpolated values. This data should be used if you intend to do any further calculations with it.

        Also read the new documentation section about doing accurate calculations: How to perform calculations accurately

    • Patches and color scheme changes which were automatically applied when importing fastf1.plotting now need to be enabled explicitly. This is done by calling fasf1.plotting.setup_mpl(). This function offers configuration through keyword arguments. The defaults are equal to what was done automatically before. It is highly recommended that you call this function to set up your matplotlib plotting environment.

    • The formatting of timedelta values in matplotlib plots is now handled by an external module called ‘Timple’. As part of this change, the function fastf1.plotting.laptime_axis() has been removed. Timedelta data is now detected automatically if matplotlib timedelta support is enabled through fastf1.plotting.setup_mpl(). This will hopefully make the plotting of timedelta values considerably more reliable.

    • The computed telemetry channels ‘Distance’ (before: ‘Space’), ‘DriverAhead’ and ‘DistanceToDriverAhead’ are no longer added to the telemetry data by default. This is done for speed and accuracy reasons. These channels can now be added by calling the appropriate Telemetry.add_*() methods of the new fastf1.core.Telemetry class.

    • The cache has been completely rewritten. It is now fully supported again and can detect version updates which require updating the cached data. Enabling the cache is now done using fastf1.api.Cache.enable_cache()

  • Changes: - Accuracy improvement: Changes to some parts of the general flow of processing data to reduce calculation errors

    • Accuracy improvement: slightly better determination of the time at which a lap starts

    • Speed improvement: Faster parsing of API data

    • Added track status information to laps data

    • Added lap accuracy validation as a boolean ‘IsAccurate’ value for each lap. This is set based on track status, availability of some required lap data, pit stops

    • Added ‘Source’ to telemetry data to indicate whether a value is original (‘car’ or ‘pos’ depending on source) or interpolated

    • Added the class fastf1.core.Lap which subclasses pd.Series. Lap is now the result of slicing fastf1.core.Laps.

    • Added additional pick_*() functions to fastf1.core.Laps

    • Added fastf1.core.Telemetry which subclasses pd.DataFrame. This class offers various methods for working with the telemetry data and should make it easier to work with the data. Previously inaccessible functionality is now accessible in a more DataFrame-like style.

    • Added various slicing capabilities for fastf1.core.Telemetry

    • Telemetry data can be sliced at any point and calculated telemetry channels (Distance, Driver Ahead, …) can be added to this slice specifically.

      Example usages:

      • ‘Distance’ can be calculated continuously over multiple laps (starts at zero on the first lap and increases all the time).

      • ‘DriverAhead’ can now be calculated for small telemetry slices more efficiently

    • DistanceToDriverAhead is reimplemented and returns a considerably smoother result now. This is at the cost of increasing integration error when used over longer periods of time (i.e. over multiple laps). To work around this, it should be applied to laps individually. Additionally, the old implementation is still available in fastf1.legacy.

    • Add a SignalR client for receiving and saving live timing and telemetry data during a session.

  • Fixed: - fix: SessionNotAvailableError is now raised as Exception instead of BaseException

    • fix a crash when there is no valid car telemetry data at all (2019, Australia, FP3)

    • fix a crash caused by the resampling progressbar when there are very few laps in a session (2019, Azerbaijan, FP1)

    • fix a crash in _inject_position when some telemetry data is missing (2019, Silverstone, FP1)

    • fix a crash when data for a session can be requested but the data does not contain any useful values at all (2020, Styria, ‘FP3’)

v2.0.2: API code overhaul

This version integrates a major overhaul of the api code (fastf1.api)

  • Possibly breaking changes:

    • Renamed dataframe column ‘LastLapTime’ to ‘LapTime’ for the dataframe returned by api.timing_data() First, this makes more sense. Second, this column is currently already renamed to ‘LapTime’ later and already accessible under this name in the dataframe returned by core.Session.load_laps(). Therefore the renaming makes the column name be consistend between api and core.

      (This also applies to the dictionary returned by the private function api._laps_data_driver()),

    • Data types in dataframes may have changed

    • Some private functions (prefixed by ‘_’) may have a different name, parameters and return value now

  • Changes: - rewrote large parts of fastf1.api with a somewhat cleaner implementation

    • more stability

    • better/more correct PitIn/PitOut and general lap data in some sessions (was missing last lap sometimes but had a first lap that didn’t actually exist

    • api.timing_data and thereby also session.load_laps will raise api.SessionNotAvailableError if the api request returned no data. This usually happens if the session never took place because it was cancelled.

    • Attempted to fix a bug where timing data from two sources can not be merged. This is caused by the received API data going backwards in time by one lap. This causes data to be added to the wrong lap. This problem was the reason for having patch files for some drivers/sessions. The patch files have now been removed as they are no longer necessary.

    • improved documentation a bit

    • light cleanup and light documentation improvements of fastf1.core

    • supressed python-levenshtein warning; it is really not necessary to have it installed for this module

    • changed logging format for hopefully better readability

    • tried to fix lap time axis again; hopefully this time I got it right

v2.0.1: Integration of a newer version of Ax6’s old repository

This integrates a more recent version of the old repository. See Issue #1

v2.0.0: first release of this fork

  • Changes:

    • fixed a bug where pandas.DataFrame functionality did not properly work with the Laps class

    • additional fixes for some minor bugs in core.get_session

  • New:

    • track: module for track and track position related stuff

    • experimental.syncsolver: an attempt at better data synchronization

v1.5.1: last release by Ax6