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

Allow more than one driver to be selected in session #78

Open
SCasanova opened this issue Jun 19, 2023 · 6 comments
Open

Allow more than one driver to be selected in session #78

SCasanova opened this issue Jun 19, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@SCasanova
Copy link
Owner

SCasanova commented Jun 19, 2023

As we move towards more functionality for users we can also allow more than one driver using .pick_drivers() instead of .pick_driver() (https://docs.fastf1.dev/core.html#fastf1.core.Laps.pick_drivers).

I'm still trying to figure out .pick_lap() to see if it's possible to use that for lap selection instead of the proposed .slice_by_lap()

@SCasanova SCasanova added the enhancement New feature or request label Jun 19, 2023
@pbulsink
Copy link
Collaborator

Looks like telemtry.slice_by_lap() actually requires a lap object to be supplied as a parameter, not just an integer value as I had assumed. Since laps.pick_lap() takes only a length one integer value (i.e. can't pick a range of laps, according to the docs), it might be best to offer:

  • fastest
  • Lap (integer, length = 1)
  • all
    as the options for which laps to pick.

As for drivers, that should be fine, as long as we can differentiate the drivers in the resulting data.frame. Might need to create a wrapping function that just calls load_telemetry() multiple times, with each unique driver_code as the supplied arguement, finishing by just row binding the results together.

@pbulsink
Copy link
Collaborator

So, I looked at this and drafted up the code - but (critically) the fastf1 return doesn't include the driver_id. If we use .pick_drivers() we get a data.frame of telemetries (similar to what you'd get from rbinding the individual driver telemetries) but without any driver_id to specify to whom each row belongs.

pbulsink added a commit to pbulsink/f1dataR that referenced this issue Jun 26, 2023
@pbulsink
Copy link
Collaborator

^ Above commit currently doesn't leave driver_id column in results...

@pbulsink
Copy link
Collaborator

Maybe it's better to update the function to allow for lap selection, but keep it limited to single driver returns? One could always manually rbind their drivers' telemetry data.frames outside of the package, but limiting the function to just fastest or all makes extracting the nth lap difficult.

pbulsink added a commit to pbulsink/f1dataR that referenced this issue Jun 26, 2023
@pbulsink pbulsink mentioned this issue Jun 26, 2023
pbulsink added a commit to pbulsink/f1dataR that referenced this issue Jul 10, 2023
@pbulsink
Copy link
Collaborator

pbulsink commented Nov 8, 2023

This is now part of FastF1 (python) and we'll have to adapt our code to match:
https://docs.fastf1.dev/changelog/index.html#what-s-new-in-v3-1-0

@SCasanova
Copy link
Owner Author

Fantastic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants