Skip to content

Commit

Permalink
Merge pull request #570 from jessedp/master
Browse files Browse the repository at this point in the history
least/top scored week should use float, not int
  • Loading branch information
cwendt94 authored Sep 12, 2024
2 parents b62b514 + f20d194 commit 7c314ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions espn_api/football/league.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ def top_scored_week(self) -> Tuple[Team, int]:
for team in self.teams:
top_week_points.append(max(team.scores[:self.current_week]))
top_scored_tup = [(i, j) for (i, j) in zip(self.teams, top_week_points)]
top_tup = sorted(top_scored_tup, key=lambda tup: int(tup[1]), reverse=True)
top_tup = sorted(top_scored_tup, key=lambda tup: float(tup[1]), reverse=True)
return top_tup[0]

def least_scored_week(self) -> Tuple[Team, int]:
least_week_points = []
for team in self.teams:
least_week_points.append(min(team.scores[:self.current_week]))
least_scored_tup = [(i, j) for (i, j) in zip(self.teams, least_week_points)]
least_tup = sorted(least_scored_tup, key=lambda tup: int(tup[1]), reverse=False)
least_tup = sorted(least_scored_tup, key=lambda tup: float(tup[1]), reverse=False)
return least_tup[0]


Expand Down

0 comments on commit 7c314ce

Please sign in to comment.