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()
andfastf1.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
andfastf1.core.DriverResult
. These classes are built on top ofpandas.DataFrame
andpandas.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 throughfastf1.get_session()
. You need to usefastf1.get_testing_session()
instead.
fastf1.core.Session.date
is now apandas.Timestamp
instead of a string.The signature
fastf1.core.Session.__init__(weekend, session_name)
has been changed tofastf1.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 offastf1.core.SessionResults
instead ofdict
. 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
tobool
, 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 withfastf1.events.Event
. All previously available methods and properties are implemented by the replacement object, although they have been partially deprecated.The attributes
name
,date
andgp
offastf1.core.Weekend
have been deprecated. The replacement objectfastf1.events.Event
subclassespandas.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
orEvent['EventName']
Weekend.date
–>Event.EventDate
orEvent['EventDate']
Weekend.gp
–>Event.RoundNumber
orEvent['RoundNumber']
The attribute
fastf1.core.Session.weekend
has been replaced byfastf1.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. Usefastf1.get_event()
instead and and get the round number from the returned event object.
fastf1.core.Session.load_laps()
has been deprecated. Usefastf1.core.Session.load()
instead, which offers more flexibility for deciding which data should be loaded. The new method will no longer return aLaps
object! You should access theLaps
object throughfastf1.core.Session.laps
fastf1.core.Driver
has been replace withfastf1.core.DriverResult
which has a different signature.The attributes
grid
,position
,name
,familyname
andteam
offastf1.core.Driver
have been deprecated. The replacement objectfastf1.core.DriverResult
subclassespandas.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
orDriverResult['FirstName']
Driver.familyname
–>DriverResult.LastName
orDriverResult['LastName']
Driver.team
–>DriverResult.TeamName
orDriverResult['TeamName']
Driver.grid
–>DriverResult.GridPosition
orDriverResult['GridPosition']
Driver.position
–>DriverResult.Position
orDriverResult['Position']