Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update pre-commit hooks #546

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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