Spaces:
Runtime error
Runtime error
tracinginsights
commited on
Commit
•
0bd345a
1
Parent(s):
1415d69
Update main.py
Browse files
main.py
CHANGED
@@ -54,7 +54,7 @@ def events_available(year: int) -> any:
|
|
54 |
|
55 |
|
56 |
@app.get("/{year}/{event}", response_model=None)
|
57 |
-
def sessions_available(year: int, event: str) -> any:
|
58 |
# get sessions available for a given year and event
|
59 |
data = available_data.LatestData(year)
|
60 |
sessions = data.get_sessions(event)
|
@@ -66,7 +66,7 @@ def sessions_available(year: int, event: str) -> any:
|
|
66 |
|
67 |
|
68 |
@app.get("/{year}/{event}/{session}", response_model=None)
|
69 |
-
def session_drivers(year: int, event: str, session: str) -> any:
|
70 |
# get drivers available for a given year, event and session
|
71 |
f1session = fastf1.get_session(year, event, session)
|
72 |
f1session.load(telemetry=False, weather=False, messages=False)
|
@@ -91,7 +91,7 @@ def session_drivers(year: int, event: str, session: str) -> any:
|
|
91 |
|
92 |
|
93 |
@app.get("/{year}/{event}/{session}/{driver}", response_model=None)
|
94 |
-
def laps_data(year: int, event: str, session: str, driver: str) -> any:
|
95 |
|
96 |
# get drivers available for a given year, event and session
|
97 |
f1session = fastf1.get_session(year, event, session)
|
@@ -134,7 +134,7 @@ def laps_data(year: int, event: str, session: str, driver: str) -> any:
|
|
134 |
|
135 |
|
136 |
@app.get("/{year}/{event}/{session}/{driver}/{lap_number}", response_model=None)
|
137 |
-
def telemetry_data(year: int, event: str, session: str, driver: str, lap_number: int) -> any:
|
138 |
|
139 |
f1session = fastf1.get_session(year, event, session)
|
140 |
f1session.load(telemetry=True, weather=False, messages=False)
|
|
|
54 |
|
55 |
|
56 |
@app.get("/{year}/{event}", response_model=None)
|
57 |
+
def sessions_available(year: int, event: str | int) -> any:
|
58 |
# get sessions available for a given year and event
|
59 |
data = available_data.LatestData(year)
|
60 |
sessions = data.get_sessions(event)
|
|
|
66 |
|
67 |
|
68 |
@app.get("/{year}/{event}/{session}", response_model=None)
|
69 |
+
def session_drivers(year: int, event: str | int, session: str) -> any:
|
70 |
# get drivers available for a given year, event and session
|
71 |
f1session = fastf1.get_session(year, event, session)
|
72 |
f1session.load(telemetry=False, weather=False, messages=False)
|
|
|
91 |
|
92 |
|
93 |
@app.get("/{year}/{event}/{session}/{driver}", response_model=None)
|
94 |
+
def laps_data(year: int, event: str | int, session: str, driver: str) -> any:
|
95 |
|
96 |
# get drivers available for a given year, event and session
|
97 |
f1session = fastf1.get_session(year, event, session)
|
|
|
134 |
|
135 |
|
136 |
@app.get("/{year}/{event}/{session}/{driver}/{lap_number}", response_model=None)
|
137 |
+
def telemetry_data(year: int, event: str | int, session: str, driver: str, lap_number: int) -> any:
|
138 |
|
139 |
f1session = fastf1.get_session(year, event, session)
|
140 |
f1session.load(telemetry=True, weather=False, messages=False)
|