Skip to content

Commit

Permalink
LINT: Updated linter
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Mar 27, 2024
1 parent 5208199 commit dfd0cb6
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.8
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: [--select=I001, --fix]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ clean-test:
rm -fr htmlcov/

ruff:
ruff . $(args)
ruff check . $(args)

format:
ruff format . --check
Expand Down
1 change: 1 addition & 0 deletions mizani/_colors/_palettes/_palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
All swatches of a palette have different lengths, are listed shortest to
longest and each swatch is longer than the previous by one color.
"""

from __future__ import annotations

import typing
Expand Down
3 changes: 2 additions & 1 deletion mizani/_colors/hsluv.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" This module is generated by transpiling Haxe into Python and cleaning
"""
This module is generated by transpiling Haxe into Python and cleaning
the resulting code by hand, e.g. removing unused Haxe classes. To try it
yourself, clone https://github.com/hsluv/hsluv and run:
Expand Down
6 changes: 2 additions & 4 deletions mizani/_core/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,11 @@ def get_tzinfo(tz: Optional[str | TzInfo] = None) -> TzInfo | None:


@overload
def datetime_to_num(x: SeqDatetime) -> NDArrayFloat:
...
def datetime_to_num(x: SeqDatetime) -> NDArrayFloat: ...


@overload
def datetime_to_num(x: Datetime) -> float:
...
def datetime_to_num(x: Datetime) -> float: ...


def datetime_to_num(x: SeqDatetime | Datetime) -> NDArrayFloat | float:
Expand Down
7 changes: 3 additions & 4 deletions mizani/bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
e.g. :math:`[0.1, 1]`. Similarly you can restrict the upper bound
-- using these functions.
"""

from __future__ import annotations

import datetime
Expand Down Expand Up @@ -284,15 +285,13 @@ def censor(
x: NDArrayFloat | Sequence[float],
range: TupleFloat2 = (0, 1),
only_finite: bool = True,
) -> NDArrayFloat:
...
) -> NDArrayFloat: ...


@overload
def censor(
x: FloatSeries, range: TupleFloat2 = (0, 1), only_finite: bool = True
) -> FloatSeries:
...
) -> FloatSeries: ...


def censor(
Expand Down
1 change: 1 addition & 0 deletions mizani/breaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
breaks make interpretation straight forward. These functions
provide ways to calculate good(hopefully) breaks.
"""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions mizani/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
representations of those values. Manipulating the string
representation of a value helps improve readability of the guide.
"""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions mizani/palettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
enforce such restrictions. This is the reason for the ``*_pal``
functions that create and return the actual palette functions.
"""

from __future__ import annotations

import colorsys
Expand Down
1 change: 1 addition & 0 deletions mizani/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
The **apply** methods are simple examples of how to put it all together.
"""

from __future__ import annotations

from typing import TYPE_CHECKING, cast
Expand Down
1 change: 1 addition & 0 deletions mizani/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
plot. The :class:`trans` is aimed at being useful for *scale* and
*coordinate* transformations.
"""

from __future__ import annotations

import sys
Expand Down
9 changes: 3 additions & 6 deletions mizani/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,11 @@ class PComparison(Protocol):
Objects that can be compaired
"""

def __eq__(self, other, /) -> bool:
...
def __eq__(self, other, /) -> bool: ...

def __lt__(self, other, /) -> bool:
...
def __lt__(self, other, /) -> bool: ...

def __gt__(self, other, /) -> bool:
...
def __gt__(self, other, /) -> bool: ...

DomainType: TypeAlias = TupleT2[PComparison]

Expand Down
6 changes: 2 additions & 4 deletions mizani/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@
@overload
def round_any(
x: FloatArrayLike, accuracy: float, f: NumericUFunction = np.round
) -> NDArrayFloat:
...
) -> NDArrayFloat: ...


@overload
def round_any(
x: float, accuracy: float, f: NumericUFunction = np.round
) -> float:
...
) -> float: ...


def round_any(
Expand Down
1 change: 1 addition & 0 deletions tools/gha_check_semver.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
The output of this script should tell you whether to publish a release
and to what index.
"""

import os
import re
from pathlib import Path
Expand Down

0 comments on commit dfd0cb6

Please sign in to comment.