Skip to content

Casper-Guo/Armchair-Strategist

Repository files navigation

Armchair Strategist

Ruff

This repository contains all the code for the armchair strategist dashboard as well as engineered data for F1 races from the 2018 season onwards.

The dashboard and visualizations in this README are updated every Monday at midnight to reflect the latest race.

Visualizations of the Most Recent Race

Pit Stop Strategies strategy
Function call: strategy_barplot(season, event)
Position Changes position
Function call: driver_stats_scatterplot(season, event, drivers=10)
Point Finishers Race Pace laptime
Function call: strategy_barplot(season, event)
Podium Finishers Gap to Winner podium gap
Function call: driver_stats_lineplot(season, event, drivers=3)
Teammate Pace Comparisons Boxplot visualization: teammate pace boxplot
Function call: driver_stats_distplot(season, event, violin=False, swarm=False, teammate_comp=True)
Violinplot with all laptimes: teammate pace violinplot
Function call: driver_stats_distplot(season, event, teammate_comp=True)
Driver Pace Comparison driver pace comparison
Function call: driver_stats_distplot(season, event)
Team Pace Ranking team pace comparison
Function call: See f1_visualization/readme_machine.py

Build

Build with pip install -e . Using a Python virtual environment is highly recommended.

Run dashboard locally with python3 app.py. Debug mode can be enabled by setting app.run(debug=True) in app.py.

Contributing

You should install pre-commit hooks with pre-commit install.

Data Source

All data sourced from the FastF1 package.

Data Availability

Data from all grand prixs and sprint races beginning in the 2018 season, excluding test sessions, are available. This repository will be automatically updated during the F1 season.

Metrics Definitions

See SCHEMA.md for details on the columns provided in Data/all_laps_*.csv and Data/transformed_laps_*.csv files.

Additional Examples

Tyre Degradation Lineplot
Function call: compounds_lineplot(seasons, events)
Tyre Degradation Distribution Plot
Function call: compounds_distplot(seasons, events)