-
Notifications
You must be signed in to change notification settings - Fork 85
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: [pre-commit.ci] pre-commit autoupdate #2535
Conversation
367b6b1
to
13ace72
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2535 +/- ##
=======================================
Coverage 98.21% 98.21%
=======================================
Files 69 69
Lines 4543 4543
Branches 804 804
=======================================
Hits 4462 4462
Misses 48 48
Partials 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pre-commit
is failing on mypy
now with
mypy with Python 3.8.....................................................Failed
- hook id: mypy
- exit code: 1
src/pyhf/tensor/numpy_backend.py:38: error: Argument 2 to "poisson_logpdf" of "numpy_backend" has incompatible type "Union[ndarray[Any, dtype[number[T@__init__]]], ndarray[Any, dtype[bool]]]"; expected "Union[ndarray[Any, dtype[number[T@log_prob]]], ndarray[Any, dtype[bool]]]" [arg-type]
src/pyhf/tensor/numpy_backend.py:51: error: Argument 2 to "normal_logpdf" of "numpy_backend" has incompatible type "Union[ndarray[Any, dtype[number[T@__init__]]], ndarray[Any, dtype[bool]]]"; expected "Union[ndarray[Any, dtype[number[T@log_prob]]], ndarray[Any, dtype[bool]]]" [arg-type]
src/pyhf/tensor/numpy_backend.py:51: error: Argument 3 to "normal_logpdf" of "numpy_backend" has incompatible type "Union[ndarray[Any, dtype[number[T@__init__]]], ndarray[Any, dtype[bool]]]"; expected "Union[ndarray[Any, dtype[number[T@log_prob]]], ndarray[Any, dtype[bool]]]" [arg-type]
Found 3 errors in 1 file (checked 72 source files)
mypy with Python 3.12....................................................Failed
- hook id: mypy
- exit code: 1
src/pyhf/tensor/numpy_backend.py:38: error: Argument 2 to "poisson_logpdf" of "numpy_backend" has incompatible type "ndarray[Any, dtype[number[T@__init__]]] | ndarray[Any, dtype[bool]]"; expected "ndarray[Any, dtype[number[T@log_prob]]] | ndarray[Any, dtype[bool]]" [arg-type]
src/pyhf/tensor/numpy_backend.py:51: error: Argument 2 to "normal_logpdf" of "numpy_backend" has incompatible type "ndarray[Any, dtype[number[T@__init__]]] | ndarray[Any, dtype[bool]]"; expected "ndarray[Any, dtype[number[T@log_prob]]] | ndarray[Any, dtype[bool]]" [arg-type]
src/pyhf/tensor/numpy_backend.py:51: error: Argument 3 to "normal_logpdf" of "numpy_backend" has incompatible type "ndarray[Any, dtype[number[T@__init__]]] | ndarray[Any, dtype[bool]]"; expected "ndarray[Any, dtype[number[T@log_prob]]] | ndarray[Any, dtype[bool]]" [arg-type]
Found 3 errors in 1 file (checked 72 source files)
Looks like there's a slightly different type coercion needed here (taking one as an example0
so need to dig into why. The with this code class _BasicPoisson:
def __init__(self, rate: Tensor[T]):
self.rate = rate
def sample(self, sample_shape: Shape) -> ArrayLike:
return poisson(self.rate).rvs(size=sample_shape + self.rate.shape) # type: ignore[no-any-return]
def log_prob(self, value: NDArray[np.number[T]]) -> ArrayLike:
tensorlib: numpy_backend[T] = numpy_backend()
return tensorlib.poisson_logpdf(value, self.rate) here, it seems to complain about |
13ace72
to
373eaae
Compare
373eaae
to
1f451bd
Compare
1f451bd
to
189be40
Compare
updates: - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.5.0 → v0.6.9](astral-sh/ruff-pre-commit@v0.5.0...v0.6.9) - [github.com/psf/black-pre-commit-mirror: 24.4.2 → 24.10.0](psf/black-pre-commit-mirror@24.4.2...24.10.0) - [github.com/pre-commit/mirrors-mypy: v1.10.1 → v1.11.2](pre-commit/mirrors-mypy@v1.10.1...v1.11.2) - [github.com/python-jsonschema/check-jsonschema: 0.28.6 → 0.29.3](python-jsonschema/check-jsonschema@0.28.6...0.29.3)
189be40
to
2a0b339
Compare
I'm going to merge this even though the CI is broken, as the other components are fine. We can follow up in #2553. |
updates: