Skip to content

feat: add tournament helpers - tz-aoe, pairwise and getting tournament by name - #232

Closed
Fruktus wants to merge 1 commit into
masterfrom
feat/tournament-helpers
Closed

feat: add tournament helpers - tz-aoe, pairwise and getting tournament by name#232
Fruktus wants to merge 1 commit into
masterfrom
feat/tournament-helpers

Conversation

@Fruktus

@Fruktus Fruktus commented May 15, 2026

Copy link
Copy Markdown
Owner

Extracted from #216 to make it easier to review later.

Provides additional tournament-related helper functions

@Fruktus
Fruktus requested a review from kjarosh as a code owner May 15, 2026 16:41
@Fruktus Fruktus changed the title feat: add tournament helpers - tz-aoe, pairwise and getting tournamen… feat: add tournament helpers - tz-aoe, pairwise and getting tournament by name May 15, 2026
@Fruktus
Fruktus force-pushed the feat/tournament-helpers branch from 23e53f5 to 9eed1d3 Compare May 15, 2026 16:43

class FullBinaryTreeIndexer:
levels: int
levels: int # Tree levels are indexed from 0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field contains the number of levels, it does not index them. What do you mean that they are indexed from 0?

Comment thread server/src/QRServer/common/utils.py Outdated

def tz_aoe() -> timezone:
"""
Returns:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be indented?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no

Comment thread server/src/QRServer/common/utils.py Outdated
return (round(new_winner_rating), round(new_loser_rating))


def pairwise(seq):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a doc about how it behaves when there's an odd number of elements + type hints.

Comment thread server/src/QRServer/db/connector.py Outdated
))
return result

async def get_tournament_by_name(self, tournament_name: str) -> Tournament | None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you need to get a tournament by name?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convenience for bot commands - we likely won't remember the ids

@Fruktus
Fruktus force-pushed the feat/tournament-helpers branch 2 times, most recently from 157e5d1 to a166218 Compare May 15, 2026 17:00
@Fruktus
Fruktus force-pushed the feat/tournament-helpers branch from a166218 to e301af9 Compare May 15, 2026 17:08
@Fruktus Fruktus closed this May 15, 2026
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

Successfully merging this pull request may close these issues.

2 participants