Jon Solow commited on
Commit
8ee1dd7
·
1 Parent(s): 8648544

Implement total scoring

Browse files
src/domain/playoffs.py CHANGED
@@ -32,6 +32,7 @@ PLAYOFF_WEEK_TO_NAME = {
32
  2: "Divisional",
33
  3: "Conference",
34
  4: "Super Bowl",
 
35
  }
36
 
37
  CURRENT_PLAYOFF_WEEK = 3
 
32
  2: "Divisional",
33
  3: "Conference",
34
  4: "Super Bowl",
35
+ 5: "Total",
36
  }
37
 
38
  CURRENT_PLAYOFF_WEEK = 3
src/pages/11_Scoreboard.py CHANGED
@@ -184,6 +184,7 @@ def assemble_user_scores(
184
  multiplier_map: dict[int, dict[int, dict[str, int]]],
185
  ) -> dict[int, dict[int, float]]:
186
  week_user_score_map: dict[int, dict[int, float]] = {w: {} for w in player_scores_map.keys()}
 
187
  for user_id, user_roster_map in roster_map.items():
188
  user_score_map: dict[int, float] = {w: 0.0 for w in player_scores_map.keys()}
189
  for roster_key, player_id in user_roster_map.items():
@@ -193,6 +194,10 @@ def assemble_user_scores(
193
  user_score_map[week] += round(player_score * multiplier, 0)
194
  for week, week_score in user_score_map.items():
195
  week_user_score_map[week][user_id] = week_score
 
 
 
 
196
  return week_user_score_map
197
 
198
 
 
184
  multiplier_map: dict[int, dict[int, dict[str, int]]],
185
  ) -> dict[int, dict[int, float]]:
186
  week_user_score_map: dict[int, dict[int, float]] = {w: {} for w in player_scores_map.keys()}
187
+ user_totals: dict[int, float] = {}
188
  for user_id, user_roster_map in roster_map.items():
189
  user_score_map: dict[int, float] = {w: 0.0 for w in player_scores_map.keys()}
190
  for roster_key, player_id in user_roster_map.items():
 
194
  user_score_map[week] += round(player_score * multiplier, 0)
195
  for week, week_score in user_score_map.items():
196
  week_user_score_map[week][user_id] = week_score
197
+ if user_id not in user_totals:
198
+ user_totals[user_id] = 0.0
199
+ user_totals[user_id] += week_score
200
+ week_user_score_map[5] = user_totals
201
  return week_user_score_map
202
 
203