diff --git a/src/hist/axis/__init__.py b/src/hist/axis/__init__.py index 4a3b7598..909d7c45 100644 --- a/src/hist/axis/__init__.py +++ b/src/hist/axis/__init__.py @@ -40,8 +40,7 @@ class AxisProtocol(Protocol): metadata: Any @property - def name(self) -> str: - ... + def name(self) -> str: ... label: str _ax: CoreAxisProtocol diff --git a/src/hist/basehist.py b/src/hist/basehist.py index 75f56e7c..027cb320 100644 --- a/src/hist/basehist.py +++ b/src/hist/basehist.py @@ -30,8 +30,7 @@ class SupportsLessThan(Protocol): - def __lt__(self, __other: Any) -> bool: - ... + def __lt__(self, __other: Any) -> bool: ... InnerIndexing = Union[ diff --git a/src/hist/interop.py b/src/hist/interop.py index 9dded1f5..495ffc15 100644 --- a/src/hist/interop.py +++ b/src/hist/interop.py @@ -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]] = {} diff --git a/src/hist/plot.py b/src/hist/plot.py index f080ab36..c46c9bbf 100644 --- a/src/hist/plot.py +++ b/src/hist/plot.py @@ -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( diff --git a/src/hist/stack.py b/src/hist/stack.py index 105f79a0..3dfdad52 100644 --- a/src/hist/stack.py +++ b/src/hist/stack.py @@ -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): diff --git a/src/hist/svgutils.py b/src/hist/svgutils.py index 5ca1bc6a..30054e6f 100644 --- a/src/hist/svgutils.py +++ b/src/hist/svgutils.py @@ -4,8 +4,7 @@ class SupportsStr(Protocol): - def __str__(self) -> str: - ... + def __str__(self) -> str: ... class XML: