Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #211

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions aiosu/models/beatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions aiosu/models/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ class ManiaPerformanceAttributes(PerformanceAttributes):
difficulty: float


class CatchPerformanceAttributes(PerformanceAttributes):
...
class CatchPerformanceAttributes(PerformanceAttributes): ...
6 changes: 2 additions & 4 deletions aiosu/utils/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
7 changes: 3 additions & 4 deletions aiosu/utils/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand All @@ -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]:
Expand Down
3 changes: 1 addition & 2 deletions tests/generate/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down