diff --git a/.github/workflows/array-api-tests.yml b/.github/workflows/array-api-tests.yml index 89bb0e1f9..a55828016 100644 --- a/.github/workflows/array-api-tests.yml +++ b/.github/workflows/array-api-tests.yml @@ -22,6 +22,7 @@ jobs: matrix: os: ["ubuntu-latest"] python-version: ["3.11"] + zarr: ["<3", ">3"] steps: - name: Checkout Cubed @@ -44,8 +45,10 @@ jobs: run: | pushd array-api-tests pip install -e '../cubed[test]' - pip install -U 'zarr<3' pip install -r requirements.txt # from Array API tests repo + - name: Install zarr${{ matrix.zarr }} + run: | + pip install -U 'zarr${{ matrix.zarr }}' - name: Run Array API tests env: ARRAY_API_TESTS_MODULE: cubed.array_api diff --git a/cubed/storage/backends/zarr_python_v3.py b/cubed/storage/backends/zarr_python_v3.py index 4589e4adb..707f0c09a 100644 --- a/cubed/storage/backends/zarr_python_v3.py +++ b/cubed/storage/backends/zarr_python_v3.py @@ -4,6 +4,9 @@ from cubed.types import T_DType, T_RegularChunks, T_Shape, T_Store +# always write empty chunks to avoid a check for each chunk +zarr.config.set({"array.write_empty_chunks": True}) + class ZarrV3ArrayGroup(dict): def __init__(