Skip to content
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
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ omit = ["*/pyhf/typing.py"]
precision = 1
sort = "cover"
show_missing = true
exclude_also = [
"if TYPE_CHECKING:"
]

[tool.mypy]
files = "src"
Expand Down
10 changes: 8 additions & 2 deletions src/pyhf/tensor/numpy_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
from __future__ import annotations

import logging
from typing import Callable, Generic, Mapping, Sequence, TypeVar, Union
from typing import TYPE_CHECKING, Callable, Generic, Mapping, Sequence, TypeVar, Union

import numpy as np
from numpy.typing import ArrayLike, DTypeLike, NBitBase, NDArray

# Needed while numpy lower bound is older than v1.21.0
if TYPE_CHECKING:
from numpy.typing import ArrayLike, DTypeLike, NBitBase, NDArray
else:
NBitBase = "NBitBase"

from scipy import special
from scipy.special import gammaln, xlogy
from scipy.stats import norm, poisson
Expand Down