Case Study 1 — The 2025 Miami Grand Prix: A Race with a Hole in It

Type: race story · Sources: OpenF1 (laps, stints, pit, race control) and Jolpica-F1 (laps, pit stops, results) · Script: code/case_study_01.py · Charts: 3

Setup

Most of the time, the two free sources in this book agree so closely that you forget there are two. From lap 2 onward, OpenF1 and Jolpica give the same lap time to the millisecond on 99.991 % of race laps in 2023–2026. This case study is about the race where that comfortable agreement breaks, and about how to rebuild a race when one source has a hole in it.

Aisha found it the way §2.7 recommends: by running the first join as an outer join and reading the rows that didn't match. Of the 453 race laps that Jolpica has and OpenF1 doesn't, 446 come from a single race, the 2025 Miami Grand Prix (round 6). The rest of this case study asks three questions. How big is the hole? Can the race still be analysed? And can we trust the parts of each source that are there?

The data

Box Box's data layer reports the problem before any analysis starts:

RaceData(2025 Miami Grand Prix, Race: 559 laps, 19 drivers, 18 pit rows, 16 track-status windows)
laps with no OpenF1 rows at all: 2.0-24.0 (23 laps)
timed laps: OpenF1 556, Jolpica 1002
OpenF1 lap 1 rows with a date_start: 0 of 19
race-control messages: 78 from lap 1 to 57

Three facts stand out:

  1. OpenF1 has no lap rows at all for laps 2–24, and only 10 cars' rows for lap 25. It has 556 timed laps, against Jolpica's 1,002.
  2. The OpenF1 rows it does have for lap 1 carry no start timestamp, so their track status is UNKNOWN.
  3. Race control is complete: 78 messages from lap 1 to lap 57. The flags, VSC periods and penalties are all there, even though the laps they apply to are not.

Figure CS1.1 shows the shape of the hole.

Bars of cars with a timed lap on each lap of the 2025 Miami GP: Jolpica has about 18-20 per lap throughout; OpenF1 has none on laps 2-24 and about half on lap 25.

📊 Figure (described): The number of cars with a timed lap on each lap of the 2025 Miami GP, in each source. Jolpica (blue) is complete from lap 1 to 57. OpenF1 (orange) has lap 1, nothing from lap 2 to 24 (shaded), about half the field on lap 25, and the full field again from lap 26. The hole covers the whole first stint of the race.

Nothing inside OpenF1 announces this. A query for one driver's laps returns 33 rows instead of 57, with no error and no warning. If you were fitting a tyre model, you would simply have fewer laps, and the first stint would quietly vanish from your degradation estimates.

Analysis

Step 1: rebuild the race story from Jolpica

Jolpica has every lap time and every running position. That is enough for the most important race chart, the race trace (gap to the leader on each lap, from cumulative lap times):

Jolpica top 6: [[1, 'PIA', 4, 'Finished'], [2, 'NOR', 2, 'Finished'], [3, 'RUS', 5, 'Finished'],
                [4, 'VER', 1, 'Finished'], [5, 'ALB', 7, 'Finished'], [6, 'ANT', 3, 'Finished']]
  PIA: gap to leader after lap 10 0.2 s, lap 15 0.0 s, lap 40 0.0 s, lap 57 0.0 s
  NOR: gap to leader after lap 10 4.2 s, lap 15 3.9 s, lap 40 6.7 s, lap 57 4.6 s
  RUS: gap to leader after lap 10 8.2 s, lap 15 10.0 s, lap 40 30.8 s, lap 57 37.6 s
  VER: gap to leader after lap 10 0.0 s, lap 15 3.6 s, lap 40 32.9 s, lap 57 40.0 s
  ALB: gap to leader after lap 10 9.0 s, lap 15 12.8 s, lap 40 39.4 s, lap 57 48.1 s
  ANT: gap to leader after lap 10 6.4 s, lap 15 8.3 s, lap 40 41.9 s, lap 57 55.5 s

Race trace of the top six finishers of the 2025 Miami GP from Jolpica lap times, with VSC deployments marked and the OpenF1 hole shaded.

📊 Figure (described): Gap to the leader at the line for the top six finishers, computed from Jolpica's cumulative lap times, with the three VSC deployments from OpenF1 race control as dotted lines and the OpenF1 hole shaded. Verstappen, who started on pole, leads the opening laps with Piastri close behind; Piastri takes the lead and the gaps to everyone except Norris grow steadily. The deep dips around laps 26–33 are pit stops and the VSC periods. The whole first stint, invisible in OpenF1, is intact here.

Jolpica's lap positions show Verstappen first at the end of laps 1–13 and Piastri first from lap 14 to the flag. Piastri won from fourth on the grid; Verstappen, from pole, finished fourth, 40.0 s behind. Every number in that paragraph comes from Jolpica, and every one of them would be unavailable or wrong if you used OpenF1 alone.

The flags come from the other source. Race control records three VSC periods, deployed on laps 2, 29 and 33 (lap numbers in race-control messages are the leader's lap):

SC/VSC/red windows:
 status                     start                       end  start_lap  duration_s
   VSC 2025-05-04 20:06:03+00:00 2025-05-04 20:09:08+00:00        2.0       185.0
   VSC 2025-05-04 20:48:05+00:00 2025-05-04 20:50:25+00:00       29.0       140.0
   VSC 2025-05-04 20:55:09+00:00 2025-05-04 20:56:44+00:00       33.0        95.0

The first VSC falls inside the OpenF1 hole. With OpenF1 laps alone, it would have no laps to flag; with Jolpica laps alone, there would be no flag to apply (Jolpica has no flags). The combination, Jolpica's laps with OpenF1's race-control timeline, gives you both.

Step 2: the pit stops, and a surprise

Jolpica's pit-stop data for this weekend hold 38 rows; OpenF1's race pit table lists 18. The book's processed tables split Jolpica's rows 18 and 20, but load them as one flat list, as many downloads and quick scripts do, and on the face of it Jolpica has found 20 stops in the hole that OpenF1 missed:

pit stops: processed Jolpica race table 18, sprint table 20, OpenF1 18
Jolpica stops by lap, race and sprint rows in one list: {10.0: 1, 11.0: 3, 12.0: 9, 13.0: 6, 14.0: 1,
                       19.0: 1, 20.0: 1, 22.0: 1, 23.0: 1, 25.0: 2, 26.0: 2, 27.0: 1, 28.0: 3, 29.0: 4, 32.0: 1, 36.0: 1}
OpenF1 stops by lap: {19: 1, 20: 1, 22: 1, 23: 1, 25: 2, 26: 2, 27: 1, 28: 3, 29: 4, 32: 1, 36: 1}

That would be a tidy story: "OpenF1 lost the first round of stops." It's wrong, and the lap times prove it. A real pit stop leaves a signature in the lap times: the in-lap and the out-lap together are much slower than two normal laps. So for every row of the pit table we compute

$$\text{signature} = t_\text{in-lap} + t_\text{next lap} - 2 \times \text{median lap of that driver}$$

using only Jolpica's own race lap times. We also bring in a second referee, the raw Jolpica CSV, which tags every pit stop with the session it belongs to (R for the race, SR for the sprint):

raw Jolpica pit stops at this weekend: {'SR': 20, 'R': 18}
lap-time signature (in-lap + next lap - 2 x driver's median lap), by raw session tag:
             count    min    50%    max
session_tag
R             18.0  15.63  24.36  52.83
SR            19.0  -0.43   1.03   3.34
race stops (tag R): 18; matched by an OpenF1 race pit row (driver, lap): 18

Scatter of lap-time signature against lap for each Jolpica pit row of the weekend: the 18 race-tagged stops sit between about 16 and 53 s, the 20 sprint-tagged rows sit near zero around laps 10-14.

📊 Figure (described): Each point is one Jolpica pit row (race and sprint) for the 2025 Miami GP. The vertical position is how much slower the "in-lap" and the following lap were than two normal laps. The 18 rows tagged R in the raw Jolpica CSV (blue) cost 16–53 s, as real stops do; the highest are stops made during the VSC on laps 28–29, whose laps are slow for two reasons. The 20 rows tagged SR (red crosses, laps 10–14) cost about one second: the race laps they point to were ordinary racing laps.

The 20 early "stops" are the Sprint's pit stops, from the day before. The raw CSV tags them correctly as SR. Any table that flattens the data without that tag puts sprint and race stops in one list (an early version of the book's own build did exactly this). The book's processed tables now keep them apart: history.pitstops() holds race stops only, and the Sprint's stops are in history.table("sprint_pitstops"). The lap times confirm the diagnosis independently: no car lost time on laps 10–14 of the race. The real race stops, all 18 of them, match OpenF1's pit table driver for driver and lap for lap. Every car that stopped in the race stopped exactly once.

The issue isn't limited to Miami. Across all seasons from 2023, the raw CSV holds 11, 40, 46 and 77 sprint-tagged pit stops (2023, 2024, 2025, 2026). Whenever you take pit stops from a source that doesn't separate the sessions, filter them on sprint weekends the way this script does: by the raw tag, or by the lap-time signature.

Step 3: what about OpenF1's stints?

OpenF1's stint table for this race has a problem of its own. It places most cars' second stint at lap 33 (Albon: MEDIUM laps 1–32, HARD laps 33–57), but both pit tables say Albon stopped on lap 26. Comparing each driver's second-stint start with the OpenF1 pit lap plus one, 15 of 18 disagree, by one to seven laps. OpenF1's compounds may still be right; its lap boundaries for this race are not. The tyre ages derived from them (tyre_age, stint_lap) inherit the error, so any tyre analysis of this race needs its stint boundaries rebuilt from the pit stops.

What it means (and doesn't)

What it means. No source is ground truth. For this one race:

Question Trust Because
Lap times and positions Jolpica complete; OpenF1 is missing laps 2–24
Flags and VSC periods OpenF1 race control complete; Jolpica has no flags
Which pit stops were in the race Jolpica rows tagged R = OpenF1 pit table two sources agree, and lap times confirm
Tyre compounds OpenF1, with care only source; boundaries need rebuilding
Stint boundaries and tyre age neither as given rebuild from the 18 confirmed stops

The general method is worth more than the specific answers: when sources disagree, find a third piece of evidence that doesn't depend on either. Here it was the lap times, which carry the physical fingerprint of a pit stop whatever any table says.

What it doesn't mean. It doesn't mean OpenF1 is unreliable in general. The hole is one race out of 91, and §2.7 showed millisecond agreement almost everywhere else. Nor does it explain why the hole exists. The data show what is missing, not what happened to the feed. And the pit-table issue is a property of how the book's processed table was built from a correctly tagged source, not an error in Jolpica's database.

What it costs. Any multi-race study that uses 2025 Miami without these checks gets a first stint with no laps (OpenF1), or 20 phantom pit stops (processed Jolpica), or tyre ages up to seven laps wrong (OpenF1 stints). Each of those would bias a different later model: degradation, pit loss, and strategy classification.

Discussion questions

  1. The first VSC (lap 2) falls inside the OpenF1 hole. Describe exactly how you would flag Jolpica's laps for that VSC, given that the window is defined by timestamps and Jolpica's laps have none. (Hint: the race started at a known time, and cumulative lap times give each car's crossing times.)
  2. The lap-time signature of the race-tagged stops ranges from 15.6 to 52.8 s. Why is it not a constant, and why is it larger for stops made during the lap-29 VSC?
  3. If you had only OpenF1, which conclusions in this case study could you still reach, and which would be wrong without your knowing it?
  4. Why is "the third piece of evidence" approach better than simply preferring the source with more rows?
  5. Suggest an automated check for the book's pipeline that would have caught the sprint stops before any chapter used them.

Your turn

Pick another sprint weekend, for example the 2026 Singapore GP. Run the same three steps: (1) coverage of OpenF1 vs Jolpica laps; (2) the pit-stop signature test with the raw session tags; (3) OpenF1 stint starts against the confirmed race stops. Write a one-paragraph verdict for each source, in the format of the table above.