jolpica / jolpica-f1

Apache License 2.0
41 stars 1 forks source link

Representation of Sprint Weekends in the Schedule Endpoint (``/races``) #47

Open theOehrly opened 3 months ago

theOehrly commented 3 months ago

Sprint weekends are currently not represented correctly in the response data of the /races endpoint. This issue only concerns the schedule endpoint and not the availability of data for the various sessions.

The sprint weekend format is generally problematic, as the order and naming of sessions has changed a lot since its introduction. Therefore, I'll also given an overview over the format for each season, in case there is any confusion.

Season 2021 and 2022 ✅

Session order: Practice 1, Qualifying, Practice 2, Sprint, Race

Original sprint format, was used in some races in 2021 and 2022. Qualifying on friday set the grid for the Sprint on saturday. The results from the Sprint set the grid for the Race on sunday. Note that "Sprint" was called "Sprint Qualifying" in 2021 but renamed in retrospect. The new name is used by Ergast and by F1 when you now look back, so I suggest we do the same. I don't know of any public API that uses the old name for the 2021 season, so we can safely ignore the naming change.

Ergast lists these as "FirstPractice", "Qualifying", "SecondPractice", "Sprint". We list them equivalently, so everything is fine here.

Season 2023 ❌

Session order: Practice 1, Qualifying, Sprint Shootout, Sprint, Race

Qualifying on friday sets the grid for the main Race on sunday. The Sprint Shootout on saturday is held in similar fashion to a normal Qualifying session and sets the grid for the Sprint that takes place on saturday as well.

Ergast lists these as "FirstPractice", "Qualifying", "SecondPractice", "Sprint". Ergast incorrectly categorizes the "SprintShootout" as "SecondPractice".

We currently don't list the sprint shootout at all, meaning we are missing one session here. I'd suggest using "SprintShootout" for the session name. This would be an intentional difference from Ergast then.

Season 2024 ❌

Session order: Practice 1, Sprint Qualifying, Sprint, Qualifying, Race

Similar to the previous ‘SprintShootout’ format, but the order of the sessions was changed and ‘Sprint Shootout’ is renamed to ‘Sprint Qualifying’. This means that the Sprint Qualifying on friday is held in similar fashion to a normal Qualifying and sets the grid for the Sprint on saturday. The Qualifying later on saturday then sets the grid for the race on Sunday.

Ergast lists these as "FirstPractice", "Qualifying", "SecondPractice", "Sprint", now incorrectly categorizing the "SprintQualifying" as "SecondPractice".

Here, we are using the same partially incorrect names as Ergast and list all sessions. I'd suggest that we rename "SecondPractice" to "SprintQualifying" to use proper naming. This would again be an intentional difference.

theOehrly commented 2 months ago

@jolpica I'll give this a shot myself. So far it feels like a fairly complex problem to get started with, but let's see how far I get.

theOehrly commented 2 months ago

Actually, let's keep this open until documented. I adjusted the labels accordingly.