Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Mar 25, 2024
1 parent d53c420 commit c24651e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/hist/axis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class AxisProtocol(Protocol):
metadata: Any

@property
def name(self) -> str:
...
def name(self) -> str: ...

label: str
_ax: CoreAxisProtocol
Expand Down
3 changes: 1 addition & 2 deletions src/hist/basehist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@


class SupportsLessThan(Protocol):
def __lt__(self, __other: Any) -> bool:
...
def __lt__(self, __other: Any) -> bool: ...


InnerIndexing = Union[
Expand Down
6 changes: 2 additions & 4 deletions src/hist/interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@


class HistogramModuleProtocol(Protocol[T_contra, U]):
def unpack(self, obj: T_contra) -> dict[str, U] | None:
...
def unpack(self, obj: T_contra) -> dict[str, U] | None: ...

def broadcast_and_flatten(
self, objects: Sequence[U | ArrayLike]
) -> tuple[np.typing.NDArray[Any], ...]:
...
) -> tuple[np.typing.NDArray[Any], ...]: ...


_histogram_modules: dict[type, HistogramModuleProtocol[Any, Any]] = {}
Expand Down
2 changes: 1 addition & 1 deletion src/hist/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _expr_to_lambda(expr: str) -> Callable[..., Any]:
varnames = list(OrderedDict.fromkeys([name for name in varnames if name != "x"]))
lambdastr = f"lambda x,{','.join(varnames)}: {expr}"
# pylint: disable-next=eval-used
return eval(lambdastr) # type: ignore[no-any-return] # noqa: PGH001
return eval(lambdastr) # type: ignore[no-any-return]


def _curve_fit_wrapper(
Expand Down
6 changes: 2 additions & 4 deletions src/hist/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,10 @@ def _get_index(self, name: str | int) -> int:
raise IndexError(f"Name not found: {name}")

@typing.overload
def __getitem__(self, val: int | str) -> BaseHist:
...
def __getitem__(self, val: int | str) -> BaseHist: ...

@typing.overload
def __getitem__(self, val: slice) -> Self:
...
def __getitem__(self, val: slice) -> Self: ...

def __getitem__(self, val: int | slice | str) -> BaseHist | Self:
if isinstance(val, str):
Expand Down
3 changes: 1 addition & 2 deletions src/hist/svgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@


class SupportsStr(Protocol):
def __str__(self) -> str:
...
def __str__(self) -> str: ...


class XML:
Expand Down

0 comments on commit c24651e

Please sign in to comment.