diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ea23d182..e846c82c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.10.0 + rev: 23.11.0 hooks: - id: black-jupyter @@ -29,19 +29,19 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.2 + rev: v0.1.5 hooks: - id: ruff args: ["--fix", "--show-fixes"] types_or: [python, pyi, jupyter] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.1 + rev: v1.7.0 hooks: - id: mypy files: ^src args: [] - additional_dependencies: ["numpy~=1.24.0", "matplotlib>=3.4", "boost-histogram~=1.3.1", "uhi~=0.3.1", "pandas-stubs>=2.0.1.230501"] + additional_dependencies: ["numpy~=1.26.0", "matplotlib>=3.4", "boost-histogram~=1.4.0", "uhi~=0.3.1", "pandas-stubs>=2.0.1.230501"] - repo: https://github.com/codespell-project/codespell rev: v2.2.6 diff --git a/src/hist/axestuple.py b/src/hist/axestuple.py index bcb1194f..0c5275e0 100644 --- a/src/hist/axestuple.py +++ b/src/hist/axestuple.py @@ -44,7 +44,7 @@ def name(self) -> tuple[str]: """ The names of the axes. May be empty strings. """ - return tuple(ax.name for ax in self) # type: ignore[return-value] + return tuple(ax.name for ax in self) @name.setter def name(self, values: Iterable[str]) -> None: @@ -72,4 +72,4 @@ def label(self) -> tuple[str]: The labels of the axes. Defaults to name if label not given, or Axis N if neither was given. """ - return tuple(ax.label for ax in self) # type: ignore[return-value] + return tuple(ax.label for ax in self) diff --git a/src/hist/svgplots.py b/src/hist/svgplots.py index c5906ba7..c7b9b64e 100644 --- a/src/hist/svgplots.py +++ b/src/hist/svgplots.py @@ -73,7 +73,9 @@ def svg_hist_1d(h: hist.BaseHist) -> svg: max_dens = np.amax(density) or 1 norm_vals: np.typing.NDArray[Any] = density / max_dens - arr = np.empty((2, len(norm_vals) * 2 + 2), dtype=float) + arr: np.typing.NDArray[np.float64] = np.empty( + (2, len(norm_vals) * 2 + 2), dtype=float + ) arr[0, 0:-1:2] = arr[0, 1::2] = width * norm_edges arr[1, 1:-2:2] = arr[1, 2:-1:2] = -height * norm_vals arr[1, 0] = arr[1, -1] = 0 @@ -122,7 +124,7 @@ def svg_hist_1d_c(h: hist.BaseHist) -> svg: max_dens = np.amax(density) or 1 norm_vals: np.typing.NDArray[Any] = density / max_dens - arr = np.empty((2, len(norm_vals) * 2), dtype=float) + arr: np.typing.NDArray[np.float64] = np.empty((2, len(norm_vals) * 2), dtype=float) arr[0, :-1:2] = arr[0, 1::2] = norm_edges[:-1] arr[1, :-1:2] = arr[1, 1::2] = inner_radius + norm_vals * (radius - inner_radius) arr[1] = np.roll(arr[1], shift=1)