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

ENH: Declare Sprint Qualifying as a quali-like session #572

Closed
wants to merge 1 commit into from

Conversation

pesaventofilippo
Copy link
Contributor

Sprint Qualifying for 2024 is now a Quali-Like session (not Race-Like like before).
Also fixes Laps.split_qualifying_sessions() for the Sprint Qualifying

Sprint Qualifying for 2024 is now a Quali-Like session (not Race-Like like before)
@theOehrly
Copy link
Owner

theOehrly commented Apr 19, 2024

Hi, this needs to be defined dependent on the season and can't just be changed globally. Else, we are breaking support for 2018.

My solution for this isn't perfect but ok, making these constants instance variables of the Session that are set in init, depending on the year.

If you have a better suggesting, I'll gladly take that.

Also, there is Norris' reinstated lap, which isn't working as well. So this will take a bit to fix overall, maybe.

@theOehrly theOehrly closed this Apr 19, 2024
@theOehrly theOehrly reopened this Apr 19, 2024
@theOehrly
Copy link
Owner

And apparently, there is a keyboard shortcut to close PRs? 😅

@pesaventofilippo
Copy link
Contributor Author

this needs to be defined dependent on the season and can't just be changed globally. Else, we are breaking support for 2018.

My bad, I thought this was a situation like with driver/color support where we only target the current year.

For now I also think the best solution is to change the behaviour depending on the year. There's not much else to do unfortunately if they reuse the same session name to mean different things in different years...

Also, there is Norris' reinstated lap, which isn't working as well.

Yes, a quick fix if anyone has problems is to use Laps.pick_fastest(only_by_time=True). I guess this is a problem with how the lap has been deleted and then reinstated, I can't recall other events where this has happened before. If someone remembers, we could test if this happens every time (for example, if a lap gets reinstated during the session or just after with a race control message?)

@theOehrly
Copy link
Owner

I think I have both things fixed. Need to check that all tests are still passing and that I haven't missed anything.

My bad, I thought this was a situation like with driver/color support where we only target the current year.

I'd prefer not to do that. And it seems straight forward enough to make it season dependent.

I guess this is a problem with how the lap has been deleted and then reinstated, I can't recall other events where this has happened before. If someone remembers, we could test if this happens every time

I don't remember another event, either. But I'd appreciate it if someone remembers, so I can use it for testing as well.

@pesaventofilippo
Copy link
Contributor Author

I just have an update: see SessionInfo.json, where "Type" is "Qualifying".

I've tried with the 2023 Austrian GP, another sprint weekend with the old format: the Sprint Shootout was of type "Qualifying", and the Sprint Race was of type "Race". This seems promising I think, should it be a property of Session, and then instead of using QUALI_LIKE and RACE_LIKE we directly check for that value?

@theOehrly
Copy link
Owner

I just have an update: see SessionInfo.json, where "Type" is "Qualifying".

I've tried with the 2023 Austrian GP, another sprint weekend with the old format: the Sprint Shootout was of type "Qualifying", and the Sprint Race was of type "Race". This seems promising I think, should it be a property of Session, and then instead of using QUALI_LIKE and RACE_LIKE we directly check for that value?

That's not a bad idea, but I think I'd delay that. It would be great for cleaning up the code a bit and having less hard-coded values. But there are some things that need to be considered additionally.

  • with that approach, the session type can only be determined after .load, now it is possible at any time
  • the Session class has limited support for sessions before 2018 that aren't available through the F1 API. For those, this isn't an option. It also isn't really necessary there, though.

I'd prefer to not make a change like that right now, as it's more involved, and I don't have the time right now to properly ensure that it works as intended in all scenarios. I'll go with the quick and dirty fix. But I'd really want to consider your suggestion for the future.

@theOehrly
Copy link
Owner

I'll close this PR as the immediate problem was resolved. Regarding the discussion about using the information from SessionInfo.json, I opened #581 so that this idea won't get lost.

@theOehrly theOehrly closed this Apr 29, 2024
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

Successfully merging this pull request may close these issues.

2 participants