From bb9bfc4feceade0eadb370058b1a86c0528b850f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:20:35 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59f462c..785513e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/asottile/pyupgrade From 79979248812a5689243250fa0bb6b8722f0ee504 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:20:56 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- aiosu/models/beatmap.py | 6 +++--- aiosu/models/performance.py | 3 +-- aiosu/utils/accuracy.py | 6 ++---- aiosu/utils/performance.py | 7 +++---- tests/generate/main.py | 3 +-- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/aiosu/models/beatmap.py b/aiosu/models/beatmap.py index 520f58e..cca0629 100644 --- a/aiosu/models/beatmap.py +++ b/aiosu/models/beatmap.py @@ -433,9 +433,9 @@ def _set_url(cls, values: dict[str, object]) -> dict[str, object]: id = values["id"] beatmapset_id = values["beatmapset_id"] mode = Gamemode(values["mode"]) - values[ - "url" - ] = f"https://osu.ppy.sh/beatmapsets/{beatmapset_id}#{mode}/{id}" + values["url"] = ( + f"https://osu.ppy.sh/beatmapsets/{beatmapset_id}#{mode}/{id}" + ) return values @classmethod diff --git a/aiosu/models/performance.py b/aiosu/models/performance.py index a40dd81..5f57463 100644 --- a/aiosu/models/performance.py +++ b/aiosu/models/performance.py @@ -38,5 +38,4 @@ class ManiaPerformanceAttributes(PerformanceAttributes): difficulty: float -class CatchPerformanceAttributes(PerformanceAttributes): - ... +class CatchPerformanceAttributes(PerformanceAttributes): ... diff --git a/aiosu/utils/accuracy.py b/aiosu/utils/accuracy.py index f9f5f84..e66f315 100644 --- a/aiosu/utils/accuracy.py +++ b/aiosu/utils/accuracy.py @@ -45,13 +45,11 @@ def get_calculator(mode: Gamemode) -> type[AbstractAccuracyCalculator]: class AbstractAccuracyCalculator(abc.ABC): @staticmethod @abc.abstractmethod - def calculate(score: Score) -> float: - ... + def calculate(score: Score) -> float: ... @staticmethod @abc.abstractmethod - def calculate_weighted(score: Score) -> float: - ... + def calculate_weighted(score: Score) -> float: ... class OsuAccuracyCalculator(AbstractAccuracyCalculator): diff --git a/aiosu/utils/performance.py b/aiosu/utils/performance.py index 58f361b..b5f461e 100644 --- a/aiosu/utils/performance.py +++ b/aiosu/utils/performance.py @@ -37,8 +37,8 @@ MANIA_BASE_MULTIPLIER = 8.0 CATCH_BASE_MULTIPLIER = 1.0 -clamp: Callable[[float, float, float], float] = ( - lambda x, l, u: l if x < l else u if x > u else x +clamp: Callable[[float, float, float], float] = lambda x, l, u: ( + l if x < l else u if x > u else x ) @@ -49,8 +49,7 @@ def __init__(self, difficulty_attributes: BeatmapDifficultyAttributes): self.difficulty_attributes = difficulty_attributes @abc.abstractmethod - def calculate(self, score: Score) -> PerformanceAttributes: - ... + def calculate(self, score: Score) -> PerformanceAttributes: ... def get_calculator(mode: Gamemode) -> type[AbstractPerformanceCalculator]: diff --git a/tests/generate/main.py b/tests/generate/main.py index ba9b29d..723cfe6 100644 --- a/tests/generate/main.py +++ b/tests/generate/main.py @@ -58,8 +58,7 @@ def _register_route( ) @abstractmethod - def _register_routes(self) -> None: - ... + def _register_routes(self) -> None: ... def _ensure_dir(self, path: str) -> None: if not os.path.exists(path):