Skip to content

Commit a1c19b9

Browse files
authored
Run array API tests on Zarr Python 2 and 3 (#733)
1 parent ff67ca2 commit a1c19b9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/array-api-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
matrix:
2323
os: ["ubuntu-latest"]
2424
python-version: ["3.11"]
25+
zarr: ["<3", ">3"]
2526

2627
steps:
2728
- name: Checkout Cubed
@@ -44,8 +45,10 @@ jobs:
4445
run: |
4546
pushd array-api-tests
4647
pip install -e '../cubed[test]'
47-
pip install -U 'zarr<3'
4848
pip install -r requirements.txt # from Array API tests repo
49+
- name: Install zarr${{ matrix.zarr }}
50+
run: |
51+
pip install -U 'zarr${{ matrix.zarr }}'
4952
- name: Run Array API tests
5053
env:
5154
ARRAY_API_TESTS_MODULE: cubed.array_api

cubed/storage/backends/zarr_python_v3.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
from cubed.types import T_DType, T_RegularChunks, T_Shape, T_Store
66

7+
# always write empty chunks to avoid a check for each chunk
8+
zarr.config.set({"array.write_empty_chunks": True})
9+
710

811
class ZarrV3ArrayGroup(dict):
912
def __init__(

0 commit comments

Comments
 (0)