-
-
Notifications
You must be signed in to change notification settings - Fork 328
[v3] support write_empty_chunks #2409
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
Comments
I opened #2429 to address this issue, but I think we should maybe take some time here to discuss what kind of API we want before moving forward with that PR. I think problems with runtime stuff as simple
|
Here's the situation I was objecting to in #2429: with config.set({'array.write_empty_chunks': True}):
arr = zarr.create(shape=(20, 20), chunks=(5, 5), fill_value=0)
arr[:] = 0 # will this use write_empty_chunks or not? how would I know? Ultimately, I think the user experience is best if they have a way to check how an array is configured. tldr; I like the idea of a
I think we could hold off on this part of the proposal for now if you want reduce scope. Not saying its |
In a universe where we take the path of #2429, users with arr1 = zarr.create(shape=(20, 20), chunks=(5, 5), fill_value=0)
arr2 = zarr.create(shape=(20, 20), chunks=(5, 5), fill_value=1)
default = config.get('array.write_empty_chunks')
print(f'the current default for write_empy_chunks is {default}')
arr1[:] = 0 # this will use the current default
# this will use the opposite of the default, for BOTH array writes
with config.set({'array.write_empty_chunks': not default}):
arr1[:] = 0
arr2[:] = 1 I'm not advocating that we do this, just sketching out how it would work. There are definitely pros and cons, and perhaps the largest is requiring a new mental model for array runtime properties. Maybe the |
Zarr version
3.0.0.beta
Numcodecs version
0.13
Python Version
3.11
Operating System
Mac
Installation
pip
Description
write_empty_chunks
was a very useful write-time optimization that we should bring back to 3.0https://zarr.readthedocs.io/en/stable/tutorial.html#empty-chunks
Steps to reproduce
Additional output
No response
The text was updated successfully, but these errors were encountered: