feat: add tournament helpers - tz-aoe, pairwise and getting tournament by name - #232
Closed
Fruktus wants to merge 1 commit into
Closed
feat: add tournament helpers - tz-aoe, pairwise and getting tournament by name#232Fruktus wants to merge 1 commit into
Fruktus wants to merge 1 commit into
Conversation
Fruktus
force-pushed
the
feat/tournament-helpers
branch
from
May 15, 2026 16:43
23e53f5 to
9eed1d3
Compare
kjarosh
reviewed
May 15, 2026
|
|
||
| class FullBinaryTreeIndexer: | ||
| levels: int | ||
| levels: int # Tree levels are indexed from 0 |
Collaborator
There was a problem hiding this comment.
This field contains the number of levels, it does not index them. What do you mean that they are indexed from 0?
kjarosh
reviewed
May 15, 2026
|
|
||
| def tz_aoe() -> timezone: | ||
| """ | ||
| Returns: |
kjarosh
reviewed
May 15, 2026
| return (round(new_winner_rating), round(new_loser_rating)) | ||
|
|
||
|
|
||
| def pairwise(seq): |
Collaborator
There was a problem hiding this comment.
Add a doc about how it behaves when there's an odd number of elements + type hints.
kjarosh
reviewed
May 15, 2026
| )) | ||
| return result | ||
|
|
||
| async def get_tournament_by_name(self, tournament_name: str) -> Tournament | None: |
Collaborator
There was a problem hiding this comment.
Why would you need to get a tournament by name?
Owner
Author
There was a problem hiding this comment.
convenience for bot commands - we likely won't remember the ids
Fruktus
force-pushed
the
feat/tournament-helpers
branch
2 times, most recently
from
May 15, 2026 17:00
157e5d1 to
a166218
Compare
Fruktus
force-pushed
the
feat/tournament-helpers
branch
from
May 15, 2026 17:08
a166218 to
e301af9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extracted from #216 to make it easier to review later.
Provides additional tournament-related helper functions