From aceedda2e85ab1cba1fa15061a9b80c37335a4b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zo=C3=A9=20Cassiop=C3=A9e=20Gauthier?= Date: Fri, 5 Apr 2024 22:26:21 -0400 Subject: [PATCH] Forgot to run ruff format --- src/pogo_scaled_estimators/calculator.py | 10 ++++++++-- src/pogo_scaled_estimators/pokebattler_proxy.py | 6 +++++- src/pogo_scaled_estimators/utilities.py | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/pogo_scaled_estimators/calculator.py b/src/pogo_scaled_estimators/calculator.py index ed81480..ed2e0b5 100644 --- a/src/pogo_scaled_estimators/calculator.py +++ b/src/pogo_scaled_estimators/calculator.py @@ -43,7 +43,11 @@ class Calculator: self._progress.update(task, advance=1) raid = Raid(raid_tier, defender, level, party) results = { - attacker: [moveset for moveset in movesets if self._pokebattler_proxy.move_type(moveset.charged_move) in self.attacker_types] + attacker: [ + moveset + for moveset in movesets + if self._pokebattler_proxy.move_type(moveset.charged_move) in self.attacker_types + ] for attacker, movesets in self._pokebattler_proxy.simulate(raid).items() if attacker in attackers } @@ -79,7 +83,9 @@ class Calculator: attacker_type = self._pokebattler_proxy.pokemon_type(attacker) fast_move_type = self._pokebattler_proxy.move_type(fast_move) charged_move_type = self._pokebattler_proxy.move_type(charged_move) - self._progress.console.print(f"[bold]{format_pokemon_name(attacker, attacker_type)}[/bold] ({format_move_name(fast_move, fast_move_type)}/{format_move_name(charged_move, charged_move_type)}): {ase:.2f}") + self._progress.console.print( + f"[bold]{format_pokemon_name(attacker, attacker_type)}[/bold] ({format_move_name(fast_move, fast_move_type)}/{format_move_name(charged_move, charged_move_type)}): {ase:.2f}" + ) def _average_estimator(self, movesets: list[Moveset]) -> float: return sum(moveset.estimator for moveset in movesets) / len(movesets) diff --git a/src/pogo_scaled_estimators/pokebattler_proxy.py b/src/pogo_scaled_estimators/pokebattler_proxy.py index cbb491f..3d90da8 100644 --- a/src/pogo_scaled_estimators/pokebattler_proxy.py +++ b/src/pogo_scaled_estimators/pokebattler_proxy.py @@ -145,7 +145,11 @@ class PokebattlerProxy: return False def with_charged_moves(self, attacker_types: list[str]) -> list[str]: - charged_moves = [move["moveId"] for move in self.moves if "moveId" in move and "type" in move and move["type"] in attacker_types] + charged_moves = [ + move["moveId"] + for move in self.moves + if "moveId" in move and "type" in move and move["type"] in attacker_types + ] return [ mon["pokemonId"] for mon in self.pokemon diff --git a/src/pogo_scaled_estimators/utilities.py b/src/pogo_scaled_estimators/utilities.py index a4714fe..44d4ada 100644 --- a/src/pogo_scaled_estimators/utilities.py +++ b/src/pogo_scaled_estimators/utilities.py @@ -22,6 +22,7 @@ POKEMON_TYPE_COLORS = { "POKEMON_TYPE_WATER": "cornflower_blue", } + def format_pokemon_name(name: str, pokemon_type: str | None = None): parts = [part.capitalize() for part in name.split("_")] if parts[-1] == "Mega" or parts[-1] == "Primal":