From a80835bdd259c45b73a92b462cfc941726486938 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 17:46:39 +0000 Subject: [PATCH 1/2] ci: pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.9 → v0.15.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.9...v0.15.10) - [github.com/tox-dev/pyproject-fmt: v2.21.0 → v2.21.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.21.0...v2.21.1) - [github.com/biomejs/pre-commit: v2.4.10 → v2.4.11](https://github.com/biomejs/pre-commit/compare/v2.4.10...v2.4.11) - [github.com/pre-commit/mirrors-mypy: v1.20.0 → v1.20.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.20.0...v1.20.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69e006b..a527af7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: - id: trailing-whitespace - id: no-commit-to-branch - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.9 + rev: v0.15.10 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] @@ -14,15 +14,15 @@ repos: args: [--preview, --select=CPY] - id: ruff-format - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.21.0 + rev: v2.21.1 hooks: - id: pyproject-fmt - repo: https://github.com/biomejs/pre-commit - rev: v2.4.10 + rev: v2.4.11 hooks: - id: biome-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.0 + rev: v1.20.1 hooks: - id: mypy args: [--config-file=pyproject.toml, .] From cb67b1484960b587a85e208be681c72251dae9ab Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Tue, 14 Apr 2026 16:14:15 +0200 Subject: [PATCH 2/2] types --- src/fast_array_utils/stats/_generic_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fast_array_utils/stats/_generic_ops.py b/src/fast_array_utils/stats/_generic_ops.py index 79df974..52a48a8 100644 --- a/src/fast_array_utils/stats/_generic_ops.py +++ b/src/fast_array_utils/stats/_generic_ops.py @@ -88,7 +88,7 @@ def _generic_op_cs( if TYPE_CHECKING: # scipy-stubs thinks e.g. "int64" is invalid, which isn’t true assert isinstance(dtype, np.dtype | type | None) # convert to array so dimensions collapse as expected - x = (sp.csr_array if x.format == "csr" else sp.csc_array)(x, **_dtype_kw(dtype, op)) # type: ignore[arg-type] + x = (sp.csr_array if x.format == "csr" else sp.csc_array)(x, **_dtype_kw(dtype, op)) # type: ignore[arg-type,call-overload] rv = cast("NDArray[Any] | types.coo_array | np.number[Any]", getattr(x, op)(axis=axis)) # old scipy versions’ sparray.{max,min}() return a 1×n/n×1 sparray here, so we squeeze return rv.toarray().squeeze() if isinstance(rv, types.coo_array) else rv