From aa73a7618075b54940d32b7b1e0e751b301bee4d Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Sat, 9 Nov 2024 18:52:45 +0100 Subject: Formatted the package with black --- src/match_up/model.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/match_up/model.py') diff --git a/src/match_up/model.py b/src/match_up/model.py index 592d60f..5d6c0f5 100644 --- a/src/match_up/model.py +++ b/src/match_up/model.py @@ -30,6 +30,7 @@ class Game: team1: Team team2: Team + @dataclass class CourtList: total: int = DEFAULT_COURTS @@ -53,21 +54,27 @@ class CourtList: inactive_courts = {k: v for k, v in self.courts.items() if not v} return active_courts, inactive_courts + def _load_csv_players(file_name: str) -> dict: with open(file_name, newline="") as file: pointer = reader(file) next(pointer, None) - players = { - id: Player(row[0], int(row[1])) for id, row in enumerate(pointer) - } + players = {id: Player(row[0], int(row[1])) for id, row in enumerate(pointer)} return players + def _generate_random_players(player_count: int = 80) -> list[Player]: - players = {i: Player(name=get_full_name(), - skill=randint(MIN_LEVEL, MAX_LEVEL), - status=bool(getrandbits(1))) for i in range(player_count)} + players = { + i: Player( + name=get_full_name(), + skill=randint(MIN_LEVEL, MAX_LEVEL), + status=bool(getrandbits(1)), + ) + for i in range(player_count) + } return players + @dataclass class PlayerList: location: str = None -- cgit v1.3.1