Spaces:
Runtime error
Runtime error
Commit
·
ad5d1a7
1
Parent(s):
48b202b
Update main.py
Browse files
main.py
CHANGED
@@ -244,7 +244,7 @@ def sessions_available(year: int, event: str | int) -> any:
|
|
244 |
return {"sessions": sessions}
|
245 |
|
246 |
# format for drivers {"drivers":[{"color":"#fff500","label":"RIC","value":"RIC"},{"color":"#ff8700","label":"NOR","value":"NOR"},{"color":"#c00000","label":"VET","value":"VET"},{"color":"#0082fa","label":"LAT","value":"LAT"},{"color":"#787878","label":"GRO","value":"GRO"},{"color":"#ffffff","label":"GAS","value":"GAS"},{"color":"#f596c8","label":"STR","value":"STR"},{"color":"#787878","label":"MAG","value":"MAG"},{"color":"#0600ef","label":"ALB","value":"ALB"},{"color":"#ffffff","label":"KVY","value":"KVY"},{"color":"#fff500","label":"OCO","value":"OCO"},{"color":"#0600ef","label":"VER","value":"VER"},{"color":"#00d2be","label":"HAM","value":"HAM"},{"color":"#ff8700","label":"SAI","value":"SAI"},{"color":"#00d2be","label":"BOT","value":"BOT"},{"color":"#960000","label":"GIO","value":"GIO"}]}
|
247 |
-
@functools.cache(
|
248 |
@st.cache_data
|
249 |
@app.get("/{year}/{event}/{session}", response_model=None)
|
250 |
def session_drivers(year: int, event: str | int, session: str) -> any:
|
@@ -271,7 +271,7 @@ def session_drivers(year: int, event: str | int, session: str) -> any:
|
|
271 |
# "VER_compound_color":"#FF5733",
|
272 |
# "lapnumber":2
|
273 |
# },{"lapnumber":3},{"VER":90.494,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":4},{"lapnumber":5},{"VER":90.062,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":6},{"lapnumber":7},{"VER":89.815,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":8},{"VER":105.248,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":9},{"lapnumber":10},{"VER":89.79,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":11},{"VER":145.101,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":12},{"lapnumber":13},{"VER":89.662,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":14},{"lapnumber":15},{"VER":89.617,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":16},{"lapnumber":17},{"VER":140.717,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":18}]}
|
274 |
-
@functools.cache(
|
275 |
@st.cache_data
|
276 |
@app.get("/{year}/{event}/{session}/{driver}", response_model=None)
|
277 |
def laps_data(year: int, event: str | int, session: str, driver: str) -> any:
|
@@ -316,7 +316,7 @@ def laps_data(year: int, event: str | int, session: str, driver: str) -> any:
|
|
316 |
|
317 |
return {"chartData": driver_laps_data}
|
318 |
|
319 |
-
@functools.cache(
|
320 |
@st.cache_data
|
321 |
@app.get("/{year}/{event}/{session}/{driver}/{lap_number}", response_model=None)
|
322 |
def telemetry_data(year: int, event: str | int, session: str, driver: str, lap_number: int) -> any:
|
|
|
244 |
return {"sessions": sessions}
|
245 |
|
246 |
# format for drivers {"drivers":[{"color":"#fff500","label":"RIC","value":"RIC"},{"color":"#ff8700","label":"NOR","value":"NOR"},{"color":"#c00000","label":"VET","value":"VET"},{"color":"#0082fa","label":"LAT","value":"LAT"},{"color":"#787878","label":"GRO","value":"GRO"},{"color":"#ffffff","label":"GAS","value":"GAS"},{"color":"#f596c8","label":"STR","value":"STR"},{"color":"#787878","label":"MAG","value":"MAG"},{"color":"#0600ef","label":"ALB","value":"ALB"},{"color":"#ffffff","label":"KVY","value":"KVY"},{"color":"#fff500","label":"OCO","value":"OCO"},{"color":"#0600ef","label":"VER","value":"VER"},{"color":"#00d2be","label":"HAM","value":"HAM"},{"color":"#ff8700","label":"SAI","value":"SAI"},{"color":"#00d2be","label":"BOT","value":"BOT"},{"color":"#960000","label":"GIO","value":"GIO"}]}
|
247 |
+
@functools.cache()
|
248 |
@st.cache_data
|
249 |
@app.get("/{year}/{event}/{session}", response_model=None)
|
250 |
def session_drivers(year: int, event: str | int, session: str) -> any:
|
|
|
271 |
# "VER_compound_color":"#FF5733",
|
272 |
# "lapnumber":2
|
273 |
# },{"lapnumber":3},{"VER":90.494,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":4},{"lapnumber":5},{"VER":90.062,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":6},{"lapnumber":7},{"VER":89.815,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":8},{"VER":105.248,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":9},{"lapnumber":10},{"VER":89.79,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":11},{"VER":145.101,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":12},{"lapnumber":13},{"VER":89.662,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":14},{"lapnumber":15},{"VER":89.617,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":16},{"lapnumber":17},{"VER":140.717,"VER_compound":"SOFT","VER_compound_color":"#FF5733","lapnumber":18}]}
|
274 |
+
@functools.cache()
|
275 |
@st.cache_data
|
276 |
@app.get("/{year}/{event}/{session}/{driver}", response_model=None)
|
277 |
def laps_data(year: int, event: str | int, session: str, driver: str) -> any:
|
|
|
316 |
|
317 |
return {"chartData": driver_laps_data}
|
318 |
|
319 |
+
@functools.cache()
|
320 |
@st.cache_data
|
321 |
@app.get("/{year}/{event}/{session}/{driver}/{lap_number}", response_model=None)
|
322 |
def telemetry_data(year: int, event: str | int, session: str, driver: str, lap_number: int) -> any:
|