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, .] 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