Skip to content

Revert change to default write_empty_chunks. #1001

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

Merged

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Apr 1, 2022

This PR resolves #965 by changing the default of write_empty_chunks to True. I am not sure if we want to document the current limitations of write_empty_chunks=False, or if we want to treat those as bugs that will be fixed eventually. In the future we may want to error if a user sets write_empty_chunks=True with an unsupported data type, but that change should probably be made in a future PR that implements the solution described in #965 (comment) and #965 (comment)

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@jeromekelleher
Copy link
Member

Great to see this, thanks @vyasr! cc @benjeffery @tomwhite

@joshmoore
Copy link
Member

I assume the general consensus is to get this out as an immediate 2.11.2?

@jni
Copy link
Contributor

jni commented Apr 4, 2022

That's my understanding!

Copy link
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

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

Thanks, @vyasr!

Merging and I'll start preparing a v2 branch for releasing from. (As a side note: slightly surprised that none of the tests needed updating. I assume that means that none are testing the default value, eh?)

@joshmoore joshmoore merged commit 6e80e97 into zarr-developers:master Apr 4, 2022
joshmoore pushed a commit to joshmoore/zarr-python that referenced this pull request Apr 4, 2022
@joshmoore joshmoore mentioned this pull request Apr 4, 2022
4 tasks
@jakirkham
Copy link
Member

Thanks all! 😄

joshmoore added a commit that referenced this pull request Apr 5, 2022
* Activate GHA for stable 2_11 branch

* Revert change to default write_empty_chunks. (#1001)

* Prepare 2.11.2 release

Co-authored-by: Vyas Ramasubramani <[email protected]>
@joshmoore
Copy link
Member

2.11.2 is released from the 2_11 branch with this PR backported.

@jakirkham
Copy link
Member

Should we create a GitHub release for that tag as well?

@joshmoore
Copy link
Member

Ah, apologies. I forgot that step. Yes, I'll do it now.

@jakirkham
Copy link
Member

Not at all. Thanks for handling this Josh 🙏

@tomwhite
Copy link
Contributor

tomwhite commented Apr 6, 2022

Thanks for releasing 2.11.2 @joshmoore. Unfortunately, it looks like it doesn't fully revert the change:

>>> import zarr
>>> zarr.__version__
'2.11.2'
>>> a = zarr.create((100, 100), chunks=(100, 50), dtype="i4", store="example.zarr")
>>> a[:] = 0
>>> import os
>>> os.listdir("example.zarr")
['.zarray']

Whereas with a previous version of Zarr (and the main branch):

>>> import zarr
>>> zarr.__version__
'2.10.3'
>>> a = zarr.create((100, 100), chunks=(100, 50), dtype="i4", store="example.zarr")
>>> a[:] = 0
>>> import os
>>> os.listdir("example.zarr")
['.zarray', '0.0', '0.1']

The problem is in zarr.creation.create where the default is still write_empty_chunks=False:

write_empty_chunks=False, **kwargs):

@jakirkham
Copy link
Member

@tomwhite would you be willing to send a PR? 🙂

@tomwhite
Copy link
Contributor

tomwhite commented Apr 6, 2022

Opened #1005

@vyasr
Copy link
Contributor Author

vyasr commented Apr 12, 2022

Ah sorry I guessed I missed one, sorry about that. Thanks for the patch @tomwhite!

@joshmoore
Copy link
Member

@vyasr : not at all. My fault.

@joshmoore
Copy link
Member

@d-v-b, if you are still planning to add an auto setting based on dtype, there are perhaps some other interesting comments regarding defaults in #8.

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.

Incorrect default fill value causes byte arrays to become numeric when write_empty_chunks=False
6 participants