Skip to content

Revert change to default write_empty_chunks.#1001

Merged
joshmoore merged 1 commit into
zarr-developers:masterfrom
vyasr:revert_write_empty_chunks_default
Apr 4, 2022
Merged

Revert change to default write_empty_chunks.#1001
joshmoore merged 1 commit into
zarr-developers:masterfrom
vyasr:revert_write_empty_chunks_default

Conversation

@vyasr

@vyasr vyasr commented Apr 1, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

@joshmoore

Copy link
Copy Markdown
Member

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

@jni

jni commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

That's my understanding!

@joshmoore joshmoore left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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 <vyas.ramasubramani@gmail.com>
@joshmoore

Copy link
Copy Markdown
Member

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

@jakirkham

Copy link
Copy Markdown
Member

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

@joshmoore

Copy link
Copy Markdown
Member

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

@jakirkham

Copy link
Copy Markdown
Member

Not at all. Thanks for handling this Josh 🙏

@tomwhite

tomwhite commented Apr 6, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

@tomwhite

tomwhite commented Apr 6, 2022

Copy link
Copy Markdown
Member

Opened #1005

@vyasr

vyasr commented Apr 12, 2022

Copy link
Copy Markdown
Contributor Author

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

@joshmoore

Copy link
Copy Markdown
Member

@vyasr : not at all. My fault.

@joshmoore

Copy link
Copy Markdown
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