From 28ef8b5cda9cc038bb103ddad94fcae28db7d835 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 17:49:32 +0000 Subject: [PATCH 1/8] 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.15 → v0.15.16](https://github.com/astral-sh/ruff-pre-commit/compare/v0.15.15...v0.15.16) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32cf75d..c1a497a 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.15 + rev: v0.15.16 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] From 3ff41e92996cb1beca2e9b796a428cd5fe1e08f8 Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 13:50:37 -0400 Subject: [PATCH 2/8] codecov --- .github/workflows/ci.yml | 14 +++++++------- .vscode/settings.json | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cb4c86..721c115 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v6 with: { fetch-depth: 0, filter: "blob:none" } - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@v8.2.0 - name: Get test environments id: get-envs run: | @@ -52,7 +52,7 @@ jobs: steps: - uses: actions/checkout@v6 with: { fetch-depth: 0, filter: "blob:none" } - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@v8.2.0 with: python-version: ${{ matrix.env.python }} - name: create environment @@ -63,12 +63,12 @@ jobs: # https://github.com/codecov/codecov-cli/issues/648 uvx hatch run ${{ matrix.env.name }}:coverage xml rm test-data/.coverage - - uses: codecov/codecov-action@v5 + - uses: codecov/codecov-action@v7 with: name: ${{ matrix.env.name }} fail_ci_if_error: true files: test-data/coverage.xml - token: ${{ secrets.CODECOV_TOKEN }} + use_oidc: true bench: name: CPU Benchmarks runs-on: ubuntu-latest @@ -78,7 +78,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3.14' - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@v8.2.0 - run: uv pip install --system --group=test -e .[full] - uses: CodSpeedHQ/action@v3 with: @@ -93,7 +93,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: '3.14' - - uses: astral-sh/setup-uv@v7 + - uses: astral-sh/setup-uv@v8.2.0 - run: uv pip install --system -e . - run: python -c 'import fast_array_utils as fau; print(fau.__all__)' - run: uv pip install --system -e .[testing] @@ -106,7 +106,7 @@ jobs: steps: - uses: actions/checkout@v6 with: { fetch-depth: 0, filter: "blob:none" } - - uses: j178/prek-action@v1 + - uses: j178/prek-action@v2 with: working-directory: ${{ github.workspace }} pass: diff --git a/.vscode/settings.json b/.vscode/settings.json index a4a891c..f1e4981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -17,6 +17,6 @@ }, "python.testing.pytestArgs": ["-vv", "--color=yes", "-m", "not benchmark"], "python.testing.pytestEnabled": true, - "python-envs.defaultEnvManager": "flying-sheep.hatch:hatch", - "python-envs.defaultPackageManager": "flying-sheep.hatch:hatch", + "python-envs.defaultEnvManager": "pypa.hatch:hatch", + "python-envs.defaultPackageManager": "pypa.hatch:hatch", } From feb4323bd930aa194cd3056a8a6de076ba6d93f2 Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 13:52:55 -0400 Subject: [PATCH 3/8] whoops --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 721c115..0693108 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,8 @@ jobs: test: name: Tests needs: get-environments + permissions: + id-token: write # for codecov OIDC runs-on: ${{ matrix.os }} strategy: matrix: From 66c3c6832f67b43952dedae213d61e3f7672feaf Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 13:55:43 -0400 Subject: [PATCH 4/8] codspeed too --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0693108..ef9fbbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,8 @@ jobs: use_oidc: true bench: name: CPU Benchmarks + permissions: + id-token: write # for codspeed OIDC runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 @@ -82,10 +84,10 @@ jobs: python-version: '3.14' - uses: astral-sh/setup-uv@v8.2.0 - run: uv pip install --system --group=test -e .[full] - - uses: CodSpeedHQ/action@v3 + - uses: CodSpeedHQ/action@v4 with: + mode: simulation run: pytest -m benchmark --codspeed -n auto - token: ${{ secrets.CODSPEED_TOKEN }} import: name: Import Tests runs-on: ubuntu-latest From 2a5c8ca0b8f4981b616bec046175f6724ba9292b Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 14:02:34 -0400 Subject: [PATCH 5/8] mypy --- .pre-commit-config.yaml | 1 + pyproject.toml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1a497a..497a0df 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,6 +40,7 @@ repos: - scikit-learn>=1.8 - scipy-stubs>=1.17 - sphinx>=9 + - types-array-api>=1.3 - types-docutils>=0.22 - zarr>=3.1 ci: diff --git a/pyproject.toml b/pyproject.toml index 0c4ebc7..ad5d18d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,12 +35,14 @@ urls.Documentation = "https://icb-fast-array-utils.readthedocs-hosted.com/" entry-points.pytest11.fast_array_utils = "testing.fast_array_utils.pytest" [dependency-groups] +dev = [ "types-array-api", "types-docutils" ] test = [ "anndata", "fast-array-utils[full]", "jax", "jaxlib", "scikit-learn", + { include-group = "dev" }, { include-group = "test-min" }, ] doc = [ From 186f2372667ac5b11d186db2d810784a8bc4c02c Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 14:13:37 -0400 Subject: [PATCH 6/8] no cache --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef9fbbb..32f6890 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,6 +113,7 @@ jobs: - uses: j178/prek-action@v2 with: working-directory: ${{ github.workspace }} + cache: false # https://github.com/j178/prek-action/issues/146 pass: name: All Checks if: always() From f0cfac3554224f42fe1473679681d5af56c8544a Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 14:17:59 -0400 Subject: [PATCH 7/8] huh --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32f6890..79ba013 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,9 +111,6 @@ jobs: - uses: actions/checkout@v6 with: { fetch-depth: 0, filter: "blob:none" } - uses: j178/prek-action@v2 - with: - working-directory: ${{ github.workspace }} - cache: false # https://github.com/j178/prek-action/issues/146 pass: name: All Checks if: always() From 32b933866046c6ed563ed6818d1c8bc4e945baa6 Mon Sep 17 00:00:00 2001 From: Phil Schaf Date: Thu, 11 Jun 2026 14:37:20 -0400 Subject: [PATCH 8/8] fix types --- .pre-commit-config.yaml | 2 +- src/fast_array_utils/stats/_generic_ops.py | 3 ++- src/fast_array_utils/stats/_power.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 497a0df..fbb6241 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: pass_filenames: false additional_dependencies: - anndata>=0.12 - - array-api-compat>=1.13 + - array-api-compat>=1.13,!=1.15.0 # https://github.com/data-apis/array-api-compat/issues/436 - dask>=2026.1 - h5py>=3.15 - jax>=0.10 diff --git a/src/fast_array_utils/stats/_generic_ops.py b/src/fast_array_utils/stats/_generic_ops.py index dd8a07b..5d260a9 100644 --- a/src/fast_array_utils/stats/_generic_ops.py +++ b/src/fast_array_utils/stats/_generic_ops.py @@ -14,6 +14,7 @@ if TYPE_CHECKING: from typing import Any, Literal + from array_api.latest import Array as AArray from numpy.typing import DTypeLike, NDArray from ..typing import CpuArray, DiskArray, GpuArray @@ -111,7 +112,7 @@ def _generic_op_dask( @generic_op.register(types.HasArrayNamespace) -def _generic_op_array_api[A: types.HasArrayNamespace]( +def _generic_op_array_api[A: AArray[object, object]]( x: A, /, op: Ops, diff --git a/src/fast_array_utils/stats/_power.py b/src/fast_array_utils/stats/_power.py index 82653a9..1d6634c 100644 --- a/src/fast_array_utils/stats/_power.py +++ b/src/fast_array_utils/stats/_power.py @@ -10,6 +10,7 @@ if TYPE_CHECKING: + from array_api.latest import Array as AArray from numpy.typing import DTypeLike from fast_array_utils.typing import CpuArray, GpuArray @@ -36,11 +37,11 @@ def _power_numpy_cupy(x: np.ndarray, n: int, /, dtype: DTypeLike | None = None) @_power.register(types.HasArrayNamespace) -def _power_array_api(x: types.HasArrayNamespace, n: int, /, dtype: DTypeLike | None = None) -> types.HasArrayNamespace: +def _power_array_api[A: AArray[object, object]](x: A, n: int, /, dtype: DTypeLike | None = None) -> A: import array_api_compat xp = array_api_compat.array_namespace(x) - return xp.pow(x, n) if dtype is None else xp.pow(xp.astype(x, dtype), n) # type: ignore[no-any-return] + return xp.pow(x, n) if dtype is None else xp.pow(xp.astype(x, dtype), n) @_power.register(types.CSBase | types.CupyCSMatrix)