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

Ties incorrectly assigned as outcomes #566

Closed
DesiPilla opened this issue Sep 6, 2024 · 1 comment
Closed

Ties incorrectly assigned as outcomes #566

DesiPilla opened this issue Sep 6, 2024 · 1 comment

Comments

@DesiPilla
Copy link
Contributor

Sport

Football

Summary

When populating the Team.outcomes attribute, the logic only considers three outcomes: Undecided (games that haven't been completed yet), Win, and Loss.

def _get_winner(self, winner: str, is_away: bool) -> str:
    if winner == "UNDECIDED":
        return "U"
    elif (is_away and winner == "AWAY") or (not is_away and winner == "HOME"):
        return "W"
    else:
        return "L"

Though ties are very rare (and even further, ties in a league that doesn't use tiebreakers), they happen. I just noticed in a league of mine from 2021, this value was wrong. In the event of a tie, both teams are given losses according to this logic.

A snapshot of what the data metadata looks like in events of a tie:

{'away': {'cumulativeScore': {'losses': 0,
   'scoreByStat': { ... },
   'statBySlot': None,
   'ties': 0,
   'wins': 0},
  'gamesPlayed': 0,
  'pointsByScoringPeriod': {'8': 108.82},
  'teamId': 1,
  'totalPoints': 108.82},
 'home': {'cumulativeScore': {'losses': 0,
   'scoreByStat': {...},
  'totalPoints': 108.82},
 'id': 29,
 'matchupPeriodId': 8,
 'winner': 'TIE'}

Logs/Data

No response

@DesiPilla DesiPilla mentioned this issue Sep 6, 2024
@cwendt94
Copy link
Owner

cwendt94 commented Sep 9, 2024

Thanks for fixing!!

@cwendt94 cwendt94 closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants