Jon Solow
commited on
Commit
·
8648544
1
Parent(s):
0b5cb5d
Print exceptions
Browse files- src/stats.py +6 -3
src/stats.py
CHANGED
@@ -201,7 +201,8 @@ def assemble_nflverse_stats() -> dict[int, dict[str, dict[str, float]]]:
|
|
201 |
def get_live_stats() -> dict[int, dict[str, dict[str, float]]]:
|
202 |
try:
|
203 |
return get_yahoo_stats()
|
204 |
-
except Exception:
|
|
|
205 |
return {w: {} for w in NFLVERSE_STAT_WEEK_TO_PLAYOFF_WEEK.values()}
|
206 |
|
207 |
|
@@ -253,7 +254,8 @@ def get_yahoo_id_map() -> dict[str, str]:
|
|
253 |
df = df[(df["yahoo_id"].notna() & df["gsis_id"].notna() & df["team"].isin(teams_included))]
|
254 |
df["yahoo_id"] = df["yahoo_id"].astype(int).astype(str)
|
255 |
return df.set_index("yahoo_id")["gsis_id"].to_dict()
|
256 |
-
except Exception:
|
|
|
257 |
return {}
|
258 |
|
259 |
|
@@ -419,7 +421,8 @@ def get_yahoo_stats() -> dict[int, dict[str, dict[str, float]]]:
|
|
419 |
def get_live_schedule() -> dict[int, dict[str, dict[str, str | int | pd.Timestamp]]]:
|
420 |
try:
|
421 |
return get_yahoo_schedule()
|
422 |
-
except Exception:
|
|
|
423 |
return {}
|
424 |
|
425 |
|
|
|
201 |
def get_live_stats() -> dict[int, dict[str, dict[str, float]]]:
|
202 |
try:
|
203 |
return get_yahoo_stats()
|
204 |
+
except Exception as e:
|
205 |
+
print(f"Failed to get yahoo live stats: {str(e)}")
|
206 |
return {w: {} for w in NFLVERSE_STAT_WEEK_TO_PLAYOFF_WEEK.values()}
|
207 |
|
208 |
|
|
|
254 |
df = df[(df["yahoo_id"].notna() & df["gsis_id"].notna() & df["team"].isin(teams_included))]
|
255 |
df["yahoo_id"] = df["yahoo_id"].astype(int).astype(str)
|
256 |
return df.set_index("yahoo_id")["gsis_id"].to_dict()
|
257 |
+
except Exception as e:
|
258 |
+
print(f"Failed to get yahoo id map: {str(e)}")
|
259 |
return {}
|
260 |
|
261 |
|
|
|
421 |
def get_live_schedule() -> dict[int, dict[str, dict[str, str | int | pd.Timestamp]]]:
|
422 |
try:
|
423 |
return get_yahoo_schedule()
|
424 |
+
except Exception as e:
|
425 |
+
print(f"Failed to get yahoo schedule: {str(e)}")
|
426 |
return {}
|
427 |
|
428 |
|