Skip to content
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

Storage options copy #221

Merged
merged 5 commits into from
Sep 7, 2022
Merged

Conversation

will-moore
Copy link
Member

This replaces #197, fixing merge conflicts between that and master and adding tests (described on the PR).

It also fixes an invalid comment and fixes a warning:

/Users/wmoore/opt/anaconda3/envs/omeroweb/lib/python3.9/site-packages/zarr/creation.py:221: UserWarning: ignoring keyword argument 'array_key'
  warn('ignoring keyword argument %r' % k)

claesenm and others added 4 commits May 11, 2022 18:34
The current implementation breaks when providing a single dict for `storage_options`, because `options.pop("chunks",...)` on line 238 removes the key `chunks` from the original `storage_options` dict after the first iteration. This happens because `options` is an alias of `storage_options` instead of a deep copy. My change fixes this and provides the intended behavior (all pyramid levels follow the same chunking scheme if `storage_options` is provided as a dict.
This fixes a zarr warning about this being ignored
Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

One API question about the da.to_zarr workflow. Otherwise, definitely valuable to have this fix tested and merged in preparation of a final release with Dask support.

I think the amended test covers the basic scenario passing a chunk size as a single storage_options dictionary. I suspect next action is to wait until we hear about #219 (comment) before merging?

Finally, re-reading #197 (review), I think we are still lacking the coverage of storage_options passed as a list of dictionaries. If it cannot easily be added in this PR, I'd propose to at least capture this as an issue so that we can come back to it.

ome_zarr/writer.py Show resolved Hide resolved
@will-moore will-moore requested review from joshmoore and removed request for joshmoore September 6, 2022 08:41
@will-moore
Copy link
Member Author

@sbesson Added test for storage_options as a list

@will-moore
Copy link
Member Author

This PR is needed to fix the tests recently added to #220

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.

3 participants