Skip to content

Commit

Permalink
Set team subranks for seeded draw generator
Browse files Browse the repository at this point in the history
  • Loading branch information
tienne-B committed Jan 14, 2025
1 parent 2265ea3 commit 68b1882
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tabbycat/draw/generator/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def generate_pairings(self, brackets):
for j, (points, teams) in enumerate(brackets.items()):
pairings[points] = []
graph = nx.Graph()
n_teams = len(teams)
n_teams = max([t.subrank for t in teams if t.subrank is not None]) # len(teams)
for t1 in teams:
for t2 in teams:
penalty = self.assignment_cost(t1, t2, n_teams, j)
Expand Down
1 change: 1 addition & 0 deletions tabbycat/draw/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def get_teams(self) -> Tuple[List['Team'], List['Team']]:

for team in teams:
team.points = 0
team.subrank = team.seed + 1

return teams, byes

Expand Down

0 comments on commit 68b1882

Please sign in to comment.