Giter Site home page Giter Site logo

theoehrly / fast-f1 Goto Github PK

View Code? Open in Web Editor NEW
2.2K 34.0 228.0 39.96 MB

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry

Home Page: https://docs.fastf1.dev

License: MIT License

Python 100.00%
formula1 datascience motorsport

fast-f1's People

Contributors

apapadoi avatar ax6 avatar bambz96 avatar bcurbs avatar bruzie avatar casper-guo avatar d-tomasino avatar dawiddzhafarov avatar daylinmorgan avatar dialtone avatar erdieee avatar f1multiviewer avatar formulatimer avatar grahamjwhite avatar harningle avatar jpmiller97 avatar lmontrieux avatar lombardoc4 avatar mdsakalu avatar neron-png avatar niallmcevoy avatar oscr avatar pesaventofilippo avatar ryanhaniff avatar spyroskoun avatar theoehrly avatar toskosz avatar tracinginsights avatar vlesierse avatar wakamex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fast-f1's Issues

Installed but not really able to do anything

Hello,

sorry for being a complete beginner to programming. But I'm not able to really do anything. just tried the example provided:

"import fastf1 as ff1
from fastf1 import plotting
from matplotlib import pyplot as plt
plotting.setup_mpl()
ff1.Cache.enable_cache('path/to/folder/for/cache') # optional but recommended
race = ff1.get_session(2020, 'Turkish Grand Prix', 'R')
laps = race.load_laps()
lec = laps.pick_driver('LEC')
ham = laps.pick_driver('HAM')"

So I'm getting an error code of:

"File "C:****\F1\F1FastTest.py", line 12, in plotting.setup_mpl()
AttributeError: module 'fastf1.plotting' has no attribute 'setup_mpl'"

and if I comment it out it gets stuck at:

"File "C:**\anaconda3\envs\spyder\lib\site-packages\requests_cache\backends\storage\dbdict.py", line 74, in connection
con = sqlite.connect(self.filename)
OperationalError: unable to open database file"

I tried several Python versions but didn't seem to fix the issue. Is it because ther eis a live session going on? Or am I just too stupid to operate this :)

Peter

Check Tyre Compound

How can we check the tyre compound and age when returning data of fastest lap of each driver?

Questions and Answers about Imola friday

For 3 times every 3 minutes, when I am recording fp1 data, cmd tells me 'received no data for more than 60 seconds, exiting'. I don't know, my connection seems stable, but maybe this is the problem and I am wrong... Anyway the file it saved is not txt but it's a file that windows doesn't recognize. Is it normal? And HOW to downgrade to 2.1.4 if I get the same problem in FP2????

UnboundLocalError: local variable 'df' referenced before assignment

For FP1 of the 2021 Emilia Romagna Grand Prix the load_laps function in core.py errors out with a UnboundLocalError on line 1192.

laps = df.reset_index(drop=True) # noqa: F821

I've traced it back to the fact that no drivers are getting any data back from the timing_app_data api call. The useful data frame is empty, so when the for each driver loop occurs the length of d2 is always 0, meaning the loop ends without df ever having being initialized as a variable.

Fast-F1/fastf1/core.py

Lines 1168 to 1190 in 8da6cbb

for i, driver in enumerate(self.drivers):
d1 = data[data['Driver'] == driver]
d2 = useful[useful['Driver'] == driver]
if len(d2) == 0:
continue # no data for this driver; skip
result = pd.merge_asof(d1, d2, on='Time', by='Driver')
# calculate lap start time by setting it to the 'Time' of the previous lap
laps_start_time = list(result['Time'])[:-1]
if self.name == 'Race':
# assumption that the first lap started when the session was started can only be made for the race
laps_start_time.insert(0, self.session_start_time)
else:
laps_start_time.insert(0, pd.NaT)
result.loc[:, 'LapStartTime'] = pd.Series(laps_start_time, dtype='timedelta64[ns]')
for npit in result['NumberOfPitStops'].unique():
sel = result['NumberOfPitStops'] == npit
result.loc[sel, 'TotalLaps'] += np.arange(0, sel.sum()) + 1
# check if df is defined already before concat (vars is a builtin function)
df = result if 'df' not in vars() else pd.concat([df, result], sort=False) # noqa: F821

Qualifying data unavailable during sprint race weekend

Hello,

I'm trying to load the data for todays qualifying and the Ergast API lookup fails (obviously not fastf1's fault).
How will getting data for this qualifying and the sprint race qualifying work if Ergast doesn't update their API?

Thank you.

StatusSeries error

So I downloaded the live data from qualifying yesterday and trying to load it into python I'm getting this error. Is it really supposed to download api data when I have the live-data downloaded? Or is it for meta data?

"runfile('C:/Users/peter/OneDrive/Dokument/F1/Live.py', wdir='C:/Users/peter/OneDrive/Dokument/F1')
core INFO Loading Bahrain Grand Prix - Qualifying
api INFO No cached data found. Downloading...
data INFO Loading live timing data. This may take a bit.
Traceback (most recent call last):

File "C:\Users\peter\OneDrive\Dokument\F1\Live.py", line 15, in
quali.load_laps(with_telemetry=True, livedata=livedata)

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\core.py", line 1141, in load_laps
data, _ = api.timing_data(self.api_path, livedata=livedata)

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\api.py", line 178, in cached_api_request
data = func(api_path, response=response, livedata=livedata)

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\api.py", line 290, in timing_data
if livedata is not None and livedata.has('TimingData'):

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 215, in has
self.load()

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 74, in load
self._load_single_file(fname)

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 112, in _load_single_file
self._parse_session_data(msg)

File "C:\Users\peter\anaconda3\envs\spyder\lib\site-packages\fastf1\livetiming\data.py", line 139, in _parse_session_data
if isinstance(msg['StatusSeries'], dict):

KeyError: 'StatusSeries'"

Problem with Spanish FP2

Hi, I am having problems with the FP2 of the Spanish GP. When trying to resample, the script crashes.

This is the error
WARNING:root:Ergast lookup failed INFO:root:Loading Spanish Grand Prix Practice 2 INFO:root:Getting summary... INFO:root:Formatting summary... INFO:root:Getting telemetry data... INFO:root:Fetching car data INFO:root:Parsing car data INFO:root:Getting position data... INFO:root:Fetching position INFO:root:Parsing position INFO:root:Resampling telemetry... Traceback (most recent call last): File "main2piloti-2.py", line 22, in <module> giri = sess.load_laps() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\utils.py", line 118, in decorator return func(*args, **kwargs) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 340, in load_laps telemetry, lap_start_date = self._load_telemetry() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 448, in _load_telemetry self._augment_position() File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 600, in _augment_position driver_ahead = self._make_trajectory(lap) File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\fastf1\core.py", line 719, in _make_trajectory dmap[:, index] = fix_suzuka(projection_index.copy(), reference_s) ValueError: could not broadcast input array from shape (33114) into shape (64013)

Microsector analysis

Hi, with Fast-F1 is it possible to create an analysis of the Microsectors? Let me explain better, a map of the circuit where the driver who made the best micro-sector is highlighted, for example in Q3. I don't know if I've made myself clear

Inconsistent Alpine Name

Only a minor issue, but the driver data in the API uses "Alpine F1 Team", the docs for plotting.TEAM_COLORS and plotting.TEAM_TRANSLATE say "Alpine F1 Team", but for me in 2.1.6 those actual dictionaries use "Alpine".

utils.delta_time function returns KeyError

import fastf1 as ff1
from fastf1 import plotting
from matplotlib import pyplot as plt
from fastf1 import utils

plotting.setup_mpl()
quali = ff1.get_session(2021, 'Bahrain', 'Q')
laps = quali.load_laps()
lec = laps.pick_driver('LEC').pick_fastest()
ham = laps.pick_driver('HAM').pick_fastest()

delta_time, ref_tel, compare_tel = utils.delta_time(ham, lec)

fig, ax = plt.subplots()

ax.plot(ref_tel['Distance'], ref_tel['Speed'],
color=plotting.TEAM_COLORS[ham['Team']])
ax.plot(compare_tel['Distance'], compare_tel['Speed'],
color=plotting.TEAM_COLORS[lec['Team']])

When executed returns this

core INFO Loading Bahrain Grand Prix - Qualifying
api INFO No cached data found. Downloading...
api INFO Fetching timing data...
api INFO Parsing timing data...
api INFO Data has been written to cache!
api INFO No cached data found. Downloading...
api INFO Fetching timing app data...
api INFO Data has been written to cache!
core INFO Processing timing data...
api INFO No cached data found. Downloading...
api INFO Fetching session status data...
api INFO Data has been written to cache!
api INFO No cached data found. Downloading...
api INFO Fetching track status data...
api INFO Data has been written to cache!
core INFO Loaded data for 20 drivers: ['33', '44', '10', '77', '11', '55', '7', '31', '18', '3', '16', '99', '22', '5', '14', '4', '63', '47', '9', '6']
Traceback (most recent call last):
File "/Users/rahul/testing.py", line 15, in
delta_time, ref_tel, compare_tel = utils.delta_time(ham, lec)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/fastf1/utils.py", line 68, in delta_time
ref = reference_lap.get_car_data(interpolate_edges=True).add_distance()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/fastf1/core.py", line 1810, in get_car_data
car_data = self.session.car_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
KeyError: '44'

get_pos_data() inconsistent logic with get_car_data()?

Dunno if I'm trying to do something I shouldn't; very new to this (and to Python). Noticed official timing app seems to be getting the telemetry data once again so I tried to see if telemetry would work again...

import fastf1 as ff1
ff1.Cache.enable_cache('/a/local/directory/i/have')  # pointed to a local dir
race = ff1.get_session(2021, 1, 'R')
lap = race.load_laps(True,) # to get telemetry with this

ham = lap.pick_driver('HAM')
# test code
tlm = get_telemetry() 

I got the following error:

Traceback (most recent call last):

  File "<ipython-input-6-182498178710>", line 1, in <module>
    tlm = ham.get_telemetry()

  File "\site-packages\fastf1\core.py", line 1524, in get_telemetry
    pos_data = self.get_pos_data(pad=1, pad_side='both')

  File "\site-packages\fastf1\core.py", line 1573, in get_pos_data
    pos_data = self.session.pos_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)

  File "\lib\site-packages\pandas\core\generic.py", line 1785, in __hash__
    raise TypeError(

TypeError: 'Lap' objects are mutable, thus they cannot be hashed

I wonder if there's an issue in the get_pos_data() since it seems to call ['DriverNumber'] instead of the actual drv_num. Compare the following lines
from get_pos_data
from get_car_data

FutureWarning pandas

/usr/local/lib/python3.8/dist-packages/fastf1/core.py:1353: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only
drv_car = Telemetry(car_data[drv].drop('Time', 1), session=self, driver=drv)
/usr/local/lib/python3.8/dist-packages/fastf1/core.py:1354: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only
drv_pos = Telemetry(pos_data[drv].drop('Time', 1), session=self, driver=drv)

F1 is breaking this on purpose, and they are probably right

Hello,
I hope my words are not taken badly, but I would like to suggest to put a sort of login procedure at the beginning of the connection which will allow only those who have a subscription to the f1 account to access the data. The F1 app is a paying app and by using this script you are allowing anyone, even those who do not have a subscription, to access the data. This was probably discovered and now F1 is removing the files on purpose, since it is removing just the data files this script basically use. So, if I may suggest, I would reconsider the policy of this app because the more you push for letting the data free of paying, the more F1 will make it difficult to get them and since the rest of the public are paying to see the numbers I personally believe they are right.

Regards
P

Issues with qualifying of Monza

This is what I get when I execute the code:

core        WARNING     Ergast API lookup failed. The session is very recent and not yet available or does not exist.
core           INFO     Loading laps for Italian Grand Prix - Qualifying [v2.1.6]
api            INFO     No cached data found for timing_data. Loading data...
api            INFO     Fetching timing data...
Traceback (most recent call last):
  File "plot_qualifying_results.py", line 25, in <module>
    laps = quali.load_laps()
  File "C:\Users\matte\Desktop\Fast-F1-master\fastf1\core.py", line 1148, in load_laps
    data, _ = api.timing_data(self.api_path, livedata=livedata)
  File "C:\Users\matte\Desktop\Fast-F1-master\fastf1\api.py", line 178, in cached_api_request
    data = func(api_path, response=response, livedata=livedata)
  File "C:\Users\matte\Desktop\Fast-F1-master\fastf1\api.py", line 296, in timing_data
    raise SessionNotAvailableError("No data for this session! Are you sure this session wasn't cancelled?")
fastf1.api.SessionNotAvailableError: No data for this session! Are you sure this session wasn't cancelled?

DRS Integer Values

I was digging through the telemetry data and I was curious about the DRS integer values.
I was not able to find anything in the documentation. Here is an example from another thread it has already been plotted:

image

Some drives have clean data sets of {0,1}, while other have a range of values from 0 to ~14.
Is there any insight to be had with the range of values or just an artifact of the data that is being pulled?

Thanks!

get_car_data() / get_telemetry errors

Having an issue pulling the car data:

race = ff1.get_session(2021, 9, 'R')
laps = race.load_laps()
ver = laps.pick_driver('VER').pick_fastest()
ver_car = ver.get_car_data()

As result I get the output below

Traceback (most recent call last):
  File "graphing.py", line 29, in <module>
    ver_car = ver.get_car_data()
  File "/Users/.../Library/Python/3.8/lib/python/site-packages/fastf1/core.py", line 1919, in get_car_data
    car_data = self.session.car_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
KeyError: '33'

Same when trying to get telemetry data instead of only car data:

race = ff1.get_session(2021, 9, 'R')
laps = race.load_laps()
ver = laps.pick_driver('VER').pick_fastest()
ver_car = ver.get_telemetry()

As result I get the output below

Traceback (most recent call last):
  File "graphing.py", line 29, in <module>
    ver_car = ver.get_telemetry()
  File "/Users/.../Library/Python/3.8/lib/python/site-packages/fastf1/core.py", line 1891, in get_telemetry
    pos_data = self.get_pos_data(pad=1, pad_side='both')
  File "/Users/.../Library/Python/3.8/lib/python/site-packages/fastf1/core.py", line 1933, in get_pos_data
    pos_data = self.session.pos_data[self['DriverNumber']].slice_by_lap(self, **kwargs).reset_index(drop=True)
KeyError: '33'

Is this also related to the DriverNumber != drv_num issue?

Information and Features

Is it possible to have a similar feature in Fast-F1 or another program that allows you to have a live telemetry graph (instead of that shit F1 graph in the app)?

I open this issue because I saw that now we need to register the live packages, so (non-programmer hypothesis) the work is halfway.

Thank you

Loading telemetry from session problem

Hello

When I try to load the laps with the with_telemetry=True option, I get the following error

gp_3_quali = ff1.get_session(2021, 3, "Q")
gp_3_quali_laps = gp_3_quali.load_laps(with_telemetry=True)

Traceback (most recent call last):

  File "<ipython-input-16-427ece08fcbb>", line 2, in <module>
    gp_3_quali_laps = gp_3_quali.load_laps(with_telemetry=True)

  File "C:\Users\User\Anaconda3\envs\py38\lib\site-packages\fastf1\core.py", line 1234, in load_laps
    self.load_telemetry()

  File "C:\Users\User\Anaconda3\envs\py38\lib\site-packages\fastf1\core.py", line 1314, in load_telemetry
    drv_car['Date'] = drv_car['Date'].round('ms')

  File "C:\Users\User\Anaconda3\envs\py38\lib\site-packages\pandas\core\series.py", line 2145, in round
    result = com.values_from_object(self).round(decimals)

TypeError: an integer is required (got type str)

Drivers' DNF

Hello!
I am having issues when I try to use the get_driver(str) method. It's behaviour is very strange, since sometimes work but sometimes doesn't. (specially with the dnf attribute)
This is the error I get:

race_session =fastf1.get_session(2004,6,'R')
print(race_session.get_driver('MSC').dnf)

if info['Driver']['code'] == identifier:
KeyError: 'code'

However, with 2002 and 2003 sessions works correctly.

Is there any other way to know if a driver had a DNF?
Thanks

Unable to parse timings from 2021 testing

race = ff1.get_session('2021',gp = 'testing')
Traceback (most recent call last):
File "", line 1, in
File "/Users/rahul/Library/Python/3.9/lib/python/site-packages/fastf1/core.py", line 132, in get_session
pre_season_week, event = _get_testing_week_event(year, event)
File "/Users/rahul/Library/Python/3.9/lib/python/site-packages/fastf1/core.py", line 196, in _get_testing_week_event
raise InvalidSessionError
fastf1.core.InvalidSessionError: No matching session can be found

I get this error when I try to load data from this season's testing

[Question and Suggestion]

Hi, how can I make a Boxplot of the times with a type of rubber? I tried, but he tells me he doesn't accept timedelta

Also, is it possible to implement a function for the SpeedDelta?

Telemetry does not contain required channels 'Time' and 'Speed' for Azerbaijan Grand Prix - Qualifying

I get the following error when trying to compare best Q laps of LEC and HAM. Other sessions work correctly:

core WARNING Ergast API lookup failed. The session is very recent and not yet available or does not exist.
core INFO Loading laps for Azerbaijan Grand Prix - Qualifying [v2.1.5]
api INFO Using cached data for timing_data
api INFO Using cached data for timing_app_data
core INFO Processing timing data...
api INFO Using cached data for session_status_data
api INFO Using cached data for track_status_data
api INFO Using cached data for car_data
api INFO Using cached data for position_data
core INFO Loaded data for 20 drivers: ['77', '31', '10', '4', '9', '63', '99', '6', '33', '44', '7', '47', '3', '55', '22', '14', '16', '5', '18', '11']
Traceback (most recent call last):

File "/home/andreak/src/Python/F1data/F1data_compare2pilots_speeds_bestLap.py", line 25, in
ax.plot(lec.telemetry['Distance'], lec.telemetry['Speed'],

File "/usr/lib/python3.9/functools.py", line 969, in get
val = self.func(instance)

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 1772, in telemetry
return self.get_telemetry()

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 1793, in get_telemetry
car_data = car_data.add_distance().add_relative_distance().add_driver_ahead()

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 797, in add_driver_ahead
drv_ahead, dist = self.calculate_driver_ahead()

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 889, in calculate_driver_ahead
drv_tel = self.session.car_data[drv].slice_by_lap(relevant_laps).add_distance() \

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 735, in add_distance
return self.join(pd.DataFrame({'Distance': self.integrate_distance()}), how='outer')

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 827, in integrate_distance
ds = self.calculate_differential_distance()

File "/home/andreak/.local/lib/python3.9/site-packages/fastf1/core.py", line 809, in calculate_differential_distance
raise ValueError("Telemetry does not contain required channels 'Time' and 'Speed'.")

ValueError: Telemetry does not contain required channels 'Time' and 'Speed'.

Unable to get telemetry data: TypeError: an integer is required (got type str)

I tried to follow the code snippet in the documentation but failed to get telemetry data so far.

import fastf1 as ff1

ff1.Cache.enable_cache('/home/kvuong/formula1/fastf1-cache')  # optional but highly recommended

monza_quali = ff1.get_session(2019, 'Monza', 'Q')

vettel = monza_quali.get_driver('VET')
print(f"Pronto {vettel.name}?")
# Pronto Se🅱️astian?

from matplotlib import pyplot as plt
from fastf1 import plotting

plotting.setup_mpl()

laps = monza_quali.load_laps(with_telemetry=True)

Following is the output:

TypeError                                 Traceback (most recent call last)
<ipython-input-18-ba43093f9722> in <module>
      4 plotting.setup_mpl()
      5 
----> 6 laps = monza_quali.load_laps(with_telemetry=True)
      7 
      8 

~/anaconda3/lib/python3.8/site-packages/fastf1/core.py in load_laps(self, with_telemetry, livedata)
   1251 
   1252         if with_telemetry:
-> 1253             self.load_telemetry(livedata=livedata)
   1254 
   1255         # load weather data; this data is not crucial, just log a warning

~/anaconda3/lib/python3.8/site-packages/fastf1/core.py in load_telemetry(self, livedata)
   1354             drv_pos = Telemetry(pos_data[drv].drop('Time', 1), session=self, driver=drv)
   1355 
-> 1356             drv_car['Date'] = drv_car['Date'].round('ms')
   1357             drv_pos['Date'] = drv_pos['Date'].round('ms')
   1358 

~/anaconda3/lib/python3.8/site-packages/pandas/core/series.py in round(self, decimals, *args, **kwargs)
   2143         Series.idxmin : Return index *label* of the first occurrence
   2144             of minimum of values.
-> 2145 
   2146         Notes
   2147         -----

TypeError: an integer is required (got type str)

I'm using fastf1-2.1.6 installed through pip, with Python 3.8.6 and matplotlib 3.2.2. Please advise!

Weather data

Hi, having a look at the livetiming data I saw that data regarding the weather are also saved. Is it possible to implement a method that returns the weather conditions during the whole race for example?

Alpine hex colour is given as nonetype object

All other cars are fine and give the correct hex colour, however alpine always seems to be classified as a none type object which causes problems later on. Anybody know of a fix to this?
Thanks

End of the session

Hi! Is there any method to know when does a session end?
Especially for qualifying sessions, just wanted to know at what time of the session does the chequered flag appeared.
(it is to know if a driver crossed the line on time and by how much)
Thanks

Session data doesn't seem to load.

I am not able to load session data for any Grand Prix, while I was able to do a couple of days ago successfully.

`import fastf1 as ff1
from fastf1 import plotting
from fastf1 import utils
import matplotlib.pyplot as plt

plotting.setup_mpl()
ff1.Cache.enable_cache('./cache')
session = ff1.get_session(2021, "Zandvoort", 'Q')`

I do not get any output for the request.

Laps on intermediate tyres not accurate

Several drivers had stints on inters at Spa FP1/FP2 and these do appear when running:
pd.DataFrame(session.load_laps(with_telemetry=True).pick_driver(driver))

However, they are missing when filtering accurate laps:
pd.DataFrame(session.load_laps(with_telemetry=True).pick_driver(driver).loc[all_laps['IsAccurate'] == True])

Documentation

Hi, could you add some examples and more precise documentation on the livetiming module and how to extract the data, etc.?

Italian GP FP2 Sainz Data

Hi, I'm trying to see the data of Sainz' accident but there are no data and times for that lap. I checked on the app and the data is there. Do you know how to solve this?

No lap data pre-2018

For some reason I cannot load lap data for any quali or race session before 2018. I just keep getting the message "No data for this session! Are you sure this session wasn't cancelled?" but then in 2018 the lap data magically appears.

Looking for the specific requests that fail and why, I get this when I got the URL for a race pre-2018:

NoSuchKey The specified key does not exist.

Not sure what to do from here.

Not working pip instal!

I'm trying to install a package, but I get this pip install git+https://github.com/theOehrly/Fast-F1.git

ERROR: Command errored out with exit status 1: git clone -q https://github.com/theOehrly/Fast-F1.git /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-req-build-ehpkyp7m Check the logs for full command output.

if I do so pip install https://github.com/theOehrly/Fast-F1.git

Collecting https://github.com/theOehrly/Fast-F1.git
Downloading https://github.com/theOehrly/Fast-F1.git
- 140 kB 423 kB/s
ERROR: Cannot unpack file /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-unpack-35yll40n/Fast-F1.git (downloaded from /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-req-build-att_ycjf, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /private/var/folders/18/hx8cytt13191h5qsp2gfp9100000gn/T/pip-req-build-att_ycjf

[Question] Pick specific lap

Hi, I know I can use pick_fastest() to get lap with best LapTime, but is it posible to pick a specific lap (i.e Lap 10 from race). I want to see the speed of a specific lap of a certain driver. Thank you!

FP1 British 2020 don't work

Traceback (most recent call last): File "main.py", line 22, in <module> giri = sess.load_laps() File "/home/**/.local/lib/python3.8/site-packages/fastf1/utils.py", line 61, in decorator return func(*args, **kwargs) File "/home/**/.local/lib/python3.8/site-packages/fastf1/core.py", line 252, in load_laps self.laps = Laps(self._load_summary()) File "/home/**/.local/lib/python3.8/site-packages/fastf1/core.py", line 324, in _load_summary t_map = {r['number']: r['Constructor']['name'] for r in self.results} AttributeError: 'Session' object has no attribute 'results'

Telemetry for lap 1?

Hi! I wanted to know if it is possible to get the telemetry of a crash on lap 1.(Sainz in sochi 2020 for example) Looks like there is no data recorded for his car, so we cannot access even the start of the first lap.
Any suggestions to access to it?
Thanks

Example throws KeyError

Hey I'm getting the following error from the example code in the Readme. Any idea what's going on?

core           INFO     Loading laps for Turkish Grand Prix - Race [v2.1.6]
api            INFO     Using cached data for timing_data
api            INFO     Using cached data for timing_app_data
core           INFO     Processing timing data...
api            INFO     Using cached data for session_status_data
api            INFO     Using cached data for track_status_data
api            INFO     Using cached data for weather_data
core           INFO     Loaded data for 20 drivers: ['18', '33', '11', '23', '3', '44', '31', '7', '77', '99', '5', '16', '20', '4', '55', '26', '8', '6', '10', '63']
Traceback (most recent call last):
  File "c:\Users\ahale\Documents\lec-ham-ex.py", line 15, in <module>
    ax.plot(lec['LapNumber'], lec['LapTime'], color='red')
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axes\_axes.py", line 1646, in plot
    lines = [*self._get_lines(*args, data=data, **kwargs)]
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axes\_base.py", line 216, in __call__
    yield from self._plot_args(this, kwargs)
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axes\_base.py", line 337, in _plot_args
    self.axes.xaxis.update_units(x)
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\matplotlib\axis.py", line 1510, in update_units
    converter = munits.registry.get_converter(data)
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\timple\patches.py", line 115, in get_converter
    if np.iterable(x) and hasattr(x[0], 'value'):
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\series.py", line 871, in __getitem__
    result = self.index.get_value(self, key)
  File "C:\Users\ahale\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pandas\core\indexes\base.py", line 4405, in get_value
    return self._engine.get_value(s, k, tz=getattr(series.dtype, "tz", None))
  File "pandas\_libs\index.pyx", line 80, in pandas._libs.index.IndexEngine.get_value
  File "pandas\_libs\index.pyx", line 90, in pandas._libs.index.IndexEngine.get_value
  File "pandas\_libs\index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas\_libs\hashtable_class_helper.pxi", line 998, in pandas._libs.hashtable.Int64HashTable.get_item
  File "pandas\_libs\hashtable_class_helper.pxi", line 1005, in pandas._libs.hashtable.Int64HashTable.get_item
KeyError: 0

Season data

Hello, first of all very nice work on fastf1. I was wondering if it is possible to get information about a season? Like the number of races, or a list with the races.

Different question: is it possible to get a session/weekend/race by date instead of year and gp name?

Kind regards, Tijmen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.