Skip to content

Commit

Permalink
attemps at bayeselo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Scezaquer authored and Scezaquer committed Jul 20, 2023
1 parent a95333d commit c3dfe9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/poprank/functional/elo.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,8 @@ def bayeselo(
players_in_interactions = set()

for interaction in interactions:
players_in_interactions.union(interaction.players)
players_in_interactions = \
players_in_interactions.union(interaction.players)
if len(interaction.players) != 2 or len(interaction.outcomes) != 2:
raise ValueError("Bayeselo only accepts interactions involving \
both a pair of players and a pair of outcomes")
Expand Down
4 changes: 2 additions & 2 deletions test/test_bayeselo.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_implementation_against_bayeselo(self):
with open(games_filepath, "r") as f:
games = json.load(f)

self.assertEquals(len(games), 7999) # Sanity check
self.assertEqual(len(games), 7999) # Sanity check

players = []
interactions = []
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_implementation_full_scale(self):
actual_elos = [EloRate(x, 0) for x in expected_results_500k["ratings"]]
actual_ranking = expected_results_500k["actual_ranking"]

self.assertEquals(len(games), 549907) # Sanity check
self.assertEqual(len(games), 549907) # Sanity check

players = []
interactions = []
Expand Down

0 comments on commit c3dfe9e

Please sign in to comment.