Skip to content

Commit f3280a7

Browse files
committed
Set write_empty_chunks to default to False
1 parent d8ac8a7 commit f3280a7

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
@@ -80,13 +80,13 @@ class Array:
8080
.. versionadded:: 2.7
8181
8282
write_empty_chunks : bool, optional
83-
If True (default), all chunks will be stored regardless of their
84-
contents. If False, each chunk is compared to the array's fill
85-
value prior to storing. If a chunk is uniformly equal to the fill
86-
value, then that chunk is not be stored, and the store entry for
87-
that chunk's key is deleted. This setting enables sparser storage,
88-
as only chunks with non-fill-value data are stored, at the expense
89-
of overhead associated with checking the data of each chunk.
83+
If True, all chunks will be stored regardless of their contents. If
84+
False (default), each chunk is compared to the array's fill value prior
85+
to storing. If a chunk is uniformly equal to the fill value, then that
86+
chunk is not be stored, and the store entry for that chunk's key is
87+
deleted. This setting enables sparser storage, as only chunks with
88+
non-fill-value data are stored, at the expense of overhead associated
89+
with checking the data of each chunk.
9090
9191
.. versionadded:: 2.11
9292
@@ -153,7 +153,7 @@ def __init__(
153153
cache_metadata=True,
154154
cache_attrs=True,
155155
partial_decompress=False,
156-
write_empty_chunks=True,
156+
write_empty_chunks=False,
157157
):
158158
# N.B., expect at this point store is fully initialized with all
159159
# configuration metadata fully specified and normalized

zarr/creation.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def create(shape, chunks=True, dtype=None, compressor='default',
2121
fill_value=0, order='C', store=None, synchronizer=None,
2222
overwrite=False, path=None, chunk_store=None, filters=None,
2323
cache_metadata=True, cache_attrs=True, read_only=False,
24-
object_codec=None, dimension_separator=None, write_empty_chunks=True, **kwargs):
24+
object_codec=None, dimension_separator=None,
25+
write_empty_chunks=False, **kwargs):
2526
"""Create an array.
2627
2728
Parameters
@@ -72,13 +73,14 @@ def create(shape, chunks=True, dtype=None, compressor='default',
7273
Separator placed between the dimensions of a chunk.
7374
.. versionadded:: 2.8
7475
write_empty_chunks : bool, optional
75-
If True (default), all chunks will be stored regardless of their
76-
contents. If False, each chunk is compared to the array's fill
77-
value prior to storing. If a chunk is uniformly equal to the fill
78-
value, then that chunk is not be stored, and the store entry for
79-
that chunk's key is deleted. This setting enables sparser storage,
80-
as only chunks with non-fill-value data are stored, at the expense
81-
of overhead associated with checking the data of each chunk.
76+
If True, all chunks will be stored regardless of their contents. If
77+
False (default), each chunk is compared to the array's fill value prior
78+
to storing. If a chunk is uniformly equal to the fill value, then that
79+
chunk is not be stored, and the store entry for that chunk's key is
80+
deleted. This setting enables sparser storage, as only chunks with
81+
non-fill-value data are stored, at the expense of overhead associated
82+
with checking the data of each chunk.
83+
.. versionadded:: 2.11
8284
8385
8486
Returns
@@ -410,7 +412,7 @@ def open_array(
410412
chunk_store=None,
411413
storage_options=None,
412414
partial_decompress=False,
413-
write_empty_chunks=True,
415+
write_empty_chunks=False,
414416
**kwargs
415417
):
416418
"""Open an array using file-mode-like semantics.
@@ -466,13 +468,14 @@ def open_array(
466468
is Blosc, when getting data from the array chunks will be partially
467469
read and decompressed when possible.
468470
write_empty_chunks : bool, optional
469-
If True (default), all chunks will be stored regardless of their
470-
contents. If False, each chunk is compared to the array's fill
471-
value prior to storing. If a chunk is uniformly equal to the fill
472-
value, then that chunk is not be stored, and the store entry for
473-
that chunk's key is deleted. This setting enables sparser storage,
474-
as only chunks with non-fill-value data are stored, at the expense
475-
of overhead associated with checking the data of each chunk.
471+
If True, all chunks will be stored regardless of their contents. If
472+
False (default), each chunk is compared to the array's fill value prior
473+
to storing. If a chunk is uniformly equal to the fill value, then that
474+
chunk is not be stored, and the store entry for that chunk's key is
475+
deleted. This setting enables sparser storage, as only chunks with
476+
non-fill-value data are stored, at the expense of overhead associated
477+
with checking the data of each chunk.
478+
.. versionadded:: 2.11
476479
477480
Returns
478481
-------

0 commit comments

Comments
 (0)