Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

least/top scored week should use float, not int #570

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading