Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/zarrs-python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Zarrs-python tests

on:
pull_request:
schedule:
# Every weekday at 03:43 UTC, see https://crontab.guru/
- cron: "43 3 * * 1-5"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.12"]

steps:
- name: Checkout source
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2

- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[test]' 'zarrs'

- name: Run tests
run: |
pytest -v
env:
CUBED_STORAGE_NAME: zarrs-python
4 changes: 4 additions & 0 deletions cubed/storage/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def open_backend_array(
elif storage_name == "zarr-python-v3":
from cubed.storage.backends.zarr_python_v3 import open_zarr_v3_array

open_func = open_zarr_v3_array
elif storage_name == "zarrs-python":
from cubed.storage.backends.zarrs_python import open_zarr_v3_array

open_func = open_zarr_v3_array
elif storage_name == "tensorstore":
from cubed.storage.backends.tensorstore import open_tensorstore_array
Expand Down
13 changes: 13 additions & 0 deletions cubed/storage/backends/zarrs_python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import zarr
import zarrs # noqa: F401

# re-export the Zarr v3 open function
from cubed.storage.backends.zarr_python_v3 import open_zarr_v3_array # noqa: F401

# need to set zarr config after importing from zarr_python_v3 to ensure pipeline is set
zarr.config.set(
{
"array.write_empty_chunks": True,
"codec_pipeline.path": "zarrs.ZarrsCodecPipeline",
}
)
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-zarr.*]
ignore_missing_imports = True
[mypy-zarrs.*]
ignore_missing_imports = True
[mypy-pyspark.*]
ignore_missing_imports = True
Loading