Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Get telemetry returns error on some laps #672

Open
mistryvivek opened this issue Jan 6, 2025 · 0 comments
Open

[BUG] Get telemetry returns error on some laps #672

mistryvivek opened this issue Jan 6, 2025 · 0 comments

Comments

@mistryvivek
Copy link

Describe the issue:

I am iterating through some laps and trying to combine telemetry data by adding the last record from the returned telemetry data to the dataset.

However, for some records, I get the following issue:

image

image

Reproduce the code example:

session = f1.get_session(year, 'Austria', 2020)
session.load()
         
combined_dataset = session.laps.reset_index(drop=True)

for idx, lap in combined_dataset.iterrows():
   telemetry_data = lap.get_telemetry()

Error message:

Traceback (most recent call last):
  File "/home/kev/PRBX/YRKCS-PRBX/Data Gathering/test.py", line 10, in <module>
    telemetry_data = lap.get_telemetry()
                     ^^^^^^^^^^^^^^^^^^^
  File "/home/kev/PRBX/YRKCS-PRBX/.venv/lib/python3.12/site-packages/fastf1/core.py", line 3471, in get_telemetry
    .add_driver_ahead() \
     ^^^^^^^^^^^^^^^^^^
  File "/home/kev/PRBX/YRKCS-PRBX/.venv/lib/python3.12/site-packages/fastf1/core.py", line 911, in add_driver_ahead
    self.calculate_driver_ahead(return_reference=True)
  File "/home/kev/PRBX/YRKCS-PRBX/.venv/lib/python3.12/site-packages/fastf1/core.py", line 1133, in calculate_driver_ahead
    index_ahead = np.argmin(delta_dst, axis=1)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kev/PRBX/YRKCS-PRBX/.venv/lib/python3.12/site-packages/numpy/_core/fromnumeric.py", line 1440, in argmin
    return _wrapfunc(a, 'argmin', axis=axis, out=out, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kev/PRBX/YRKCS-PRBX/.venv/lib/python3.12/site-packages/numpy/_core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^
ValueError: attempt to get argmin of an empty sequence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant