Skip to content

Commit 6b461a7

Browse files
committed
Set write_empty_chunks to default to False
1 parent e6483f9 commit 6b461a7

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

zarr/core.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ class Array:
8181
.. versionadded:: 2.7
8282
8383
write_empty_chunks : bool, optional
84-
If True (default), all chunks will be stored regardless of their
85-
contents. If False, each chunk is compared to the array's fill
86-
value prior to storing. If a chunk is uniformly equal to the fill
87-
value, then that chunk is not be stored, and the store entry for
88-
that chunk's key is deleted. This setting enables sparser storage,
89-
as only chunks with non-fill-value data are stored, at the expense
90-
of overhead associated with checking the data of each chunk.
84+
If True, all chunks will be stored regardless of their contents. If
85+
False (default), each chunk is compared to the array's fill value prior
86+
to storing. If a chunk is uniformly equal to the fill value, then that
87+
chunk is not be stored, and the store entry for that chunk's key is
88+
deleted. This setting enables sparser storage, as only chunks with
89+
non-fill-value data are stored, at the expense of overhead associated
90+
with checking the data of each chunk.
9191
9292
.. versionadded:: 2.11
9393
@@ -154,7 +154,7 @@ def __init__(
154154
cache_metadata=True,
155155
cache_attrs=True,
156156
partial_decompress=False,
157-
write_empty_chunks=True,
157+
write_empty_chunks=False,
158158
):
159159
# N.B., expect at this point store is fully initialized with all
160160
# configuration metadata fully specified and normalized

zarr/creation.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def create(shape, chunks=True, dtype=None, compressor='default',
1919
fill_value=0, order='C', store=None, synchronizer=None,
2020
overwrite=False, path=None, chunk_store=None, filters=None,
2121
cache_metadata=True, cache_attrs=True, read_only=False,
22-
object_codec=None, dimension_separator=None, write_empty_chunks=True, **kwargs):
22+
object_codec=None, dimension_separator=None,
23+
write_empty_chunks=False, **kwargs):
2324
"""Create an array.
2425
2526
Parameters
@@ -70,13 +71,14 @@ def create(shape, chunks=True, dtype=None, compressor='default',
7071
Separator placed between the dimensions of a chunk.
7172
.. versionadded:: 2.8
7273
write_empty_chunks : bool, optional
73-
If True (default), all chunks will be stored regardless of their
74-
contents. If False, each chunk is compared to the array's fill
75-
value prior to storing. If a chunk is uniformly equal to the fill
76-
value, then that chunk is not be stored, and the store entry for
77-
that chunk's key is deleted. This setting enables sparser storage,
78-
as only chunks with non-fill-value data are stored, at the expense
79-
of overhead associated with checking the data of each chunk.
74+
If True, all chunks will be stored regardless of their contents. If
75+
False (default), each chunk is compared to the array's fill value prior
76+
to storing. If a chunk is uniformly equal to the fill value, then that
77+
chunk is not be stored, and the store entry for that chunk's key is
78+
deleted. This setting enables sparser storage, as only chunks with
79+
non-fill-value data are stored, at the expense of overhead associated
80+
with checking the data of each chunk.
81+
.. versionadded:: 2.11
8082
8183
8284
Returns
@@ -387,7 +389,7 @@ def open_array(
387389
chunk_store=None,
388390
storage_options=None,
389391
partial_decompress=False,
390-
write_empty_chunks=True,
392+
write_empty_chunks=False,
391393
**kwargs
392394
):
393395
"""Open an array using file-mode-like semantics.
@@ -443,13 +445,14 @@ def open_array(
443445
is Blosc, when getting data from the array chunks will be partially
444446
read and decompressed when possible.
445447
write_empty_chunks : bool, optional
446-
If True (default), all chunks will be stored regardless of their
447-
contents. If False, each chunk is compared to the array's fill
448-
value prior to storing. If a chunk is uniformly equal to the fill
449-
value, then that chunk is not be stored, and the store entry for
450-
that chunk's key is deleted. This setting enables sparser storage,
451-
as only chunks with non-fill-value data are stored, at the expense
452-
of overhead associated with checking the data of each chunk.
448+
If True, all chunks will be stored regardless of their contents. If
449+
False (default), each chunk is compared to the array's fill value prior
450+
to storing. If a chunk is uniformly equal to the fill value, then that
451+
chunk is not be stored, and the store entry for that chunk's key is
452+
deleted. This setting enables sparser storage, as only chunks with
453+
non-fill-value data are stored, at the expense of overhead associated
454+
with checking the data of each chunk.
455+
.. versionadded:: 2.11
453456
454457
Returns
455458
-------

0 commit comments

Comments
 (0)