Skip to content

Commit 2f33e9a

Browse files
authored
fix(types): check with UHI 0.1.2 (#523)
1 parent 5c2643b commit 2f33e9a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ repos:
7373
hooks:
7474
- id: mypy
7575
files: src
76-
additional_dependencies: [numpy==1.20.1]
76+
additional_dependencies: [numpy==1.20.1, uhi==0.1.2]
7777

7878
- repo: https://github.com/mgedmin/check-manifest
7979
rev: "0.46"

src/boost_histogram/_internal/hist.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import warnings
55
from os import cpu_count
66
from typing import (
7+
TYPE_CHECKING,
78
Any,
89
Callable,
910
Dict,
@@ -1013,3 +1014,11 @@ def counts(self, flow: bool = False) -> np.ndarray:
10131014
return view.count # type: ignore
10141015
else:
10151016
return view.value # type: ignore
1017+
1018+
1019+
if TYPE_CHECKING:
1020+
import typing
1021+
1022+
from uhi.typing.plottable import PlottableHistogram
1023+
1024+
_: PlottableHistogram = typing.cast(Histogram, None)

0 commit comments

Comments
 (0)