From 51dd7d4934e87b8efe9e63be47314c21177c7b09 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:05:01 -0500 Subject: [PATCH] chore: update pre-commit hooks (#546) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black-pre-commit-mirror: 23.10.0 → 23.11.0](https://github.com/psf/black-pre-commit-mirror/compare/23.10.0...23.11.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.2 → v0.1.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.2...v0.1.5) - [github.com/pre-commit/mirrors-mypy: v1.6.1 → v1.7.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.1...v1.7.0) --------- Signed-off-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner Co-authored-by: Henry Schreiner --- .pre-commit-config.yaml | 8 ++++---- src/hist/axestuple.py | 4 ++-- src/hist/svgplots.py | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) 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)