An open API service indexing awesome lists of open source software.

https://github.com/Casper-Guo/Armchair-Strategist

Strategy dashboard for all F1 races since 2018
https://github.com/Casper-Guo/Armchair-Strategist

data-visualization f1 formula1 python

Last synced: about 3 hours ago
JSON representation

Strategy dashboard for all F1 races since 2018

Awesome Lists containing this project

README

          

# Armchair Strategist

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

This repository contains all the code for the [armchair strategist dashboard](www.armchair-strategist.dev) as well as engineered data for F1 races from the 2018 season onwards.

The visualizations in this README are automatically updated to reflect the latest race.

## Visualizations of the Most Recent Race


Pit Stop Strategies

strategy


Function call:

strategy_barplot(season, event, session_type)


Position Changes

position


Function call:

driver_stats_scatterplot(season, event, session_type)


Point Finishers Race Pace

laptime


Function call:

strategy_barplot(season, event, session_type, drivers=10)


Fuel-adjusted lap times

fuel_adjusted


Function call:

driver_stats_scatterplot(season, event, session_type, drivers=10, y="FuelAdjLapTime")


Podium Finishers Gap to Winner

podium gap


Function call:


add_gap(winner, modify_global=True, season, session_type)


driver_stats_lineplot(season, event, session_type, drivers=3, y="GapTo{winner}")


Race Trace to Winner Average Pace

race trace


Function call:


add_gap(winner, modify_global=True, distribute_pit_loss=True, season, session_type)


driver_stats_lineplot(season, event, session_type, drivers=3, y="GapTo{winner}Pace")


Teammate Pace Comparisons

Boxplot visualization:
teammate pace boxplot


Function call:

driver_stats_distplot(season, event, session_type, violin=False, swarm=False, teammate_comp=True)

Violinplot with all laptimes:
teammate pace violinplot


Function call:

driver_stats_distplot(season, event, session_type, teammate_comp=True)


Driver Pace Comparison

driver pace comparison


Function call:

driver_stats_distplot(season, event, session_type)


Team Pace Ranking

team pace comparison


Function call:

See readme_machine.py

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

## [Dashboard](www.armchair-strategist.dev)
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](https://github.com/theOehrly/Fast-F1) 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)