Skip to content

Commit

Permalink
chore: update pre-commit hooks (#546)
Browse files Browse the repository at this point in the history
<!--pre-commit.ci start-->
updates:
- [github.com/psf/black-pre-commit-mirror: 23.10.0 →
23.11.0](psf/black-pre-commit-mirror@23.10.0...23.11.0)
- [github.com/astral-sh/ruff-pre-commit: v0.1.2 →
v0.1.5](astral-sh/ruff-pre-commit@v0.1.2...v0.1.5)
- [github.com/pre-commit/mirrors-mypy: v1.6.1 →
v1.7.0](pre-commit/mirrors-mypy@v1.6.1...v1.7.0)
<!--pre-commit.ci end-->

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Henry Schreiner <henry.fredrick.schreiner@cern.ch>
Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
3 people authored Nov 14, 2023
1 parent 41e1eff commit 51dd7d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/hist/axestuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
6 changes: 4 additions & 2 deletions src/hist/svgplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 51dd7d4

Please sign in to comment.