Jon Solow commited on
Commit
6b5ee7e
·
1 Parent(s): f27cc58

Use new stats as preferred for this week

Browse files
Files changed (1) hide show
  1. src/stats.py +7 -6
src/stats.py CHANGED
@@ -517,12 +517,11 @@ def get_stats_map() -> dict[int, dict[str, dict[str, float]]]:
517
  # use live stats if available
518
  stat_map = get_live_stats()
519
 
520
- # try live fallback for current week if nothing yet
521
- if not stat_map.get(CURRENT_PLAYOFF_WEEK):
522
- try:
523
- stat_map[CURRENT_PLAYOFF_WEEK] = get_live_yahoo_stats_from_txt()[CURRENT_PLAYOFF_WEEK]
524
- except Exception as e:
525
- print(f"Failed to get yahoo live backup method: {str(e)}")
526
 
527
  # use more permanent nflverse stats over live
528
  nflverse_stats = assemble_nflverse_stats()
@@ -697,6 +696,8 @@ LIVE_YAHOO_STAT_COLUMNS = {
697
 
698
 
699
  YAHOO_TEAM_ID_MAP = {
 
 
700
  "21": teams.philadelphia_eagles.team_short_name,
701
  "28": teams.washington_football_team.team_short_name,
702
  }
 
517
  # use live stats if available
518
  stat_map = get_live_stats()
519
 
520
+ # try live better stats
521
+ try:
522
+ stat_map[CURRENT_PLAYOFF_WEEK] = get_live_yahoo_stats_from_txt()[CURRENT_PLAYOFF_WEEK]
523
+ except Exception as e:
524
+ print(f"Failed to get yahoo live backup method: {str(e)}")
 
525
 
526
  # use more permanent nflverse stats over live
527
  nflverse_stats = assemble_nflverse_stats()
 
696
 
697
 
698
  YAHOO_TEAM_ID_MAP = {
699
+ "2": teams.buffalo_bills.team_short_name,
700
+ "12": teams.kansas_city_chiefs.team_short_name,
701
  "21": teams.philadelphia_eagles.team_short_name,
702
  "28": teams.washington_football_team.team_short_name,
703
  }