Jon Solow commited on
Commit
6d8b23b
·
1 Parent(s): 83551c4

Add opponent to fix points allowed

Browse files
Files changed (1) hide show
  1. src/stats.py +2 -1
src/stats.py CHANGED
@@ -382,12 +382,14 @@ def get_yahoo_schedule() -> dict[int, dict[str, dict[str, str | int | pd.Timesta
382
  {
383
  "score": home_score,
384
  "opponent_score": away_score,
 
385
  }
386
  )
387
  away_team_map.update(
388
  {
389
  "score": away_score,
390
  "opponent_score": home_score,
 
391
  }
392
  )
393
 
@@ -455,7 +457,6 @@ def get_schedule_with_live() -> dict[int, dict[str, dict[str, str | int | pd.Tim
455
 
456
  def add_points_against_team_win_stat(stat_map: dict[int, dict[str, dict[str, float]]]):
457
  schedule = get_schedule_with_live()
458
-
459
  for week, week_map in stat_map.items():
460
  for player_id in week_map.keys():
461
  if team_short_name := DEFENSE_PLAYER_ID_TO_ROSTER_TEAM_NAMES.get(player_id):
 
382
  {
383
  "score": home_score,
384
  "opponent_score": away_score,
385
+ "opponent": away_team,
386
  }
387
  )
388
  away_team_map.update(
389
  {
390
  "score": away_score,
391
  "opponent_score": home_score,
392
+ "opponent": home_team,
393
  }
394
  )
395
 
 
457
 
458
  def add_points_against_team_win_stat(stat_map: dict[int, dict[str, dict[str, float]]]):
459
  schedule = get_schedule_with_live()
 
460
  for week, week_map in stat_map.items():
461
  for player_id in week_map.keys():
462
  if team_short_name := DEFENSE_PLAYER_ID_TO_ROSTER_TEAM_NAMES.get(player_id):