-
-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3] fix: zarr v2 compatibility fixes for Dask #2186
Conversation
- port normalize_chunks from v2 - add array.store property - default to append in create
src/zarr/core/chunk_grids.py
Outdated
if all(isinstance(c, (tuple | list)) for c in chunks): | ||
# take first chunk size for each dimension | ||
chunks = ( | ||
c[0] for c in chunks | ||
) # TODO: check/error/warn for irregular chunks (e.g. if c[0] != c[1:-1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
except for this block, the rest of this function came from 2.x
Hi @jhamman - thanks for looking into this! Here is what we're doing to load remote data with dask and Zarr v2...
With zarr v3 I'm not getting as far as opening with dask as I'm failing to access any remote data, using a couple of different approaches here (using zarr from this branch), both failing with exceptions noted below...
Is there some other way that I can try to load remote data? Many thanks, |
also fix failing ci
Thanks for trying this out @will-moore. Can you share the full traceback? In the meantime, I would expect something like g = zarr.open_group(store=zarr.store.RemoteStore("s3://idr", endpoint_url="http://uk1s3.embassy.ebi.ac.uk", anon=True), path="zarr/v0.4/idr0062A/6001240.zarr") Can you let us know if that works? It doesn't for me, but I'm not sure if some network / authentication setup is required. |
…nto fix/dask-compat
That sample you tried there is zarr v2 data, and it also seemed to need
gives me:
On my machine, I unfortunately get: this error
Which is an issue that seems to affect just me, as I already reported at ome/ome2024-ngff-challenge#22 and I can't seem to fix on my machine, which is kinda annoying! Thanks for your help! |
…nto fix/dask-compat
src/zarr/core/array.py
Outdated
parents = [ | ||
AsyncGroup( | ||
metadata=GroupMetadata(zarr_format=node.metadata.zarr_format), | ||
store_path=StorePath(store=node.store_path.store, path=""), | ||
) | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TomAugspurger - this was needed to enable zarr.create(store={}, path="a")
such that the root zarr.json
is created in addition to a/zarr.json
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to go i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple minor things.
src/zarr/core/array.py
Outdated
@@ -635,6 +639,8 @@ async def _save_metadata(self, metadata: ArrayMetadata, ensure_parents: bool = F | |||
# To enable zarr.create(store, path="a/b/c"), we need to create all the intermediate groups. | |||
parents = _build_parents(self) | |||
|
|||
logger.debug("Ensure parents: %s", parents) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep this?
parents = [] | ||
store = node.store_path.store | ||
path = node.store_path.path | ||
if not path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know whether this branch is covered by an existing test? If not, it might be good to add one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this path is highly exercised.
normalize_chunks
from v2array.store
propertycreate
zarr.store
tozarr.storage
closes #1953
xref: dask/dask#11388
TODO: