Spaces:
Running
Running
import streamlit as st | |
from repo_directory import Race_Launch_Performance_Ratings as rl | |
from repo_directory import button, utils | |
YEAR_SELECTED = st.selectbox( | |
'Select Year', | |
(2024,2023, 2022, 2021, 2020, 2019, 2018)) | |
RACE_SELECTED = st.selectbox( | |
'Select Race', | |
utils.get_events(YEAR_SELECTED)) | |
SESSION = st.selectbox( | |
'Select Session', | |
('R', 'SQ')) | |
reaction_df, drivers, laps = rl.get_laps_and_drivers(YEAR_SELECTED, RACE_SELECTED, SESSION) | |
DRIVERS_REMOVED = st.multiselect( | |
'Remove drivers starting from pitlane', | |
drivers.tolist() | |
) | |
REMAINING_DRIVERS = list(set(drivers.tolist()) - set(DRIVERS_REMOVED)) | |
ratings_df = rl.get_ratings(laps, drivers, reaction_df, REMAINING_DRIVERS) | |
rl.plot_ratings(ratings_df,YEAR_SELECTED, RACE_SELECTED, SESSION) |