Skip to content

feat: add pure zarr-python Async Reader - #902

Merged
vincentsarago merged 22 commits into
mainfrom
feat/add-async-zarr-reader
Apr 10, 2026
Merged

vincentsarago merged 22 commits into
mainfrom
feat/add-async-zarr-reader

Conversation

@vincentsarago

@vincentsarago vincentsarago commented Apr 7, 2026 •

Copy link
Copy Markdown
Member
# pseudo code

store = zarr.storage.MemoryStore()
arr = await zarr.api.asynchronous.open_array(store=zarr_store, mode="r")

crs = ... # Get CRS from Zarr Store metadata
transform = ... # Get Transform from Zarr Store metadata 

reader = AsyncZarrReader(arr, crs=crs, transform=transform)
img = await reader.tile(0, 0, 0)

Comment thread rio_tiler/experimental/_async.py Resolved
Comment thread rio_tiler/experimental/_async.py Resolved
Comment thread rio_tiler/experimental/_async.py Resolved
Comment thread rio_tiler/experimental/_async.py Resolved
Comment thread tests/test_async_zarr.py
assert pt.band_names == ["b1"]


async def test_compat_xarray(zarr_dataset):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate that we get the same results using xarray/zarr

@vincentsarago

Copy link
Copy Markdown
Member Author

Q: Zarr-python doesn't have the concept of coordinates (e.g in xarray you get the coordinates indexes for each dimension if present).

In the current implementation if you have a (3, x, y) array we can't tell what the first dimension represent in values.

@d-v-b

d-v-b commented Apr 9, 2026

Copy link
Copy Markdown

Q: Zarr-python doesn't have the concept of coordinates (e.g in xarray you get the coordinates indexes for each dimension if present).

In the current implementation if you have a (3, x, y) array we can't tell what the first dimension represent in values.

yes that's correct, in zarr there's no formal concept of coordinates. xarray uses a combination of annotations on a single array (to name the coordinates) and separate arrays (the actual coordinate values) to generate this representation

Comment thread rio_tiler/experimental/_async.py Resolved
@vincentsarago
vincentsarago marked this pull request as ready for review April 9, 2026 16:59
@@ -0,0 +1,375 @@
"""rio_tiler experimental ZarrReaders."""

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old Xarray based Zarr reader

@vincentsarago vincentsarago changed the title feat: add pure ZarrPython Async Reader feat: add pure zarr-python Async Reader Apr 10, 2026
@vincentsarago
vincentsarago merged commit 6fd494b into main Apr 10, 2026
7 checks passed
@vincentsarago
vincentsarago deleted the feat/add-async-zarr-reader branch April 10, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants