Skip to content

Commit 04519bd

Browse files
joshmoorevyasr
andauthored
2.11.2 release (#1002)
* 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]>
1 parent 0fc6a1e commit 04519bd

File tree

7 files changed

+33
-20
lines changed

7 files changed

+33
-20
lines changed

.github/workflows/minimal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Minimal installation
44

55
on:
66
push:
7-
branches: [ master ]
7+
branches: [ master, 2_11 ]
88
pull_request:
9-
branches: [ master ]
9+
branches: [ master, 2_11 ]
1010

1111
jobs:
1212
minimum_build:

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Linux Testing
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ master, 2_11 ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ master, 2_11 ]
1111

1212
jobs:
1313
build:

.github/workflows/windows-testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Python package
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ master, 2_11 ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ master, 2_11 ]
1111

1212
jobs:
1313
windows:

docs/release.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ Release notes
66
Unreleased
77
----------
88

9+
.. _release_2.11.2:
10+
11+
2.11.2
12+
------
13+
14+
Bug fixes
15+
~~~~~~~~~
16+
17+
* Changes the default value of ``write_empty_chunks`` to ``True`` to prevent
18+
unanticipated data losses when the data types do not have a proper default
19+
value when empty chunks are read back in.
20+
By :user:`Vyas Ramasubramani <vyasr>`; :issue:`965`.
21+
922
.. _release_2.11.1:
1023

1124
2.11.1

docs/tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ Empty chunks
13091309

13101310
As of version 2.11, it is possible to configure how Zarr handles the storage of
13111311
chunks that are "empty" (i.e., every element in the chunk is equal to the array's fill value).
1312-
When creating an array with ``write_empty_chunks=False`` (the default),
1312+
When creating an array with ``write_empty_chunks=False``,
13131313
Zarr will check whether a chunk is empty before compression and storage. If a chunk is empty,
13141314
then Zarr does not store it, and instead deletes the chunk from storage
13151315
if the chunk had been previously stored.
@@ -1318,7 +1318,7 @@ This optimization prevents storing redundant objects and can speed up reads, but
13181318
added computation during array writes, since the contents of
13191319
each chunk must be compared to the fill value, and these advantages are contingent on the content of the array.
13201320
If you know that your data will form chunks that are almost always non-empty, then there is no advantage to the optimization described above.
1321-
In this case, creating an array with ``write_empty_chunks=True`` will instruct Zarr to write every chunk without checking for emptiness.
1321+
In this case, creating an array with ``write_empty_chunks=True`` (the default) will instruct Zarr to write every chunk without checking for emptiness.
13221322

13231323
The following example illustrates the effect of the ``write_empty_chunks`` flag on
13241324
the time required to write an array with different values.::

zarr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def __init__(
154154
cache_metadata=True,
155155
cache_attrs=True,
156156
partial_decompress=False,
157-
write_empty_chunks=False,
157+
write_empty_chunks=True,
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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ def create(shape, chunks=True, dtype=None, compressor='default',
7373
.. versionadded:: 2.8
7474
7575
write_empty_chunks : bool, optional
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
76+
If True (default), all chunks will be stored regardless of their
77+
contents. If False, each chunk is compared to the array's fill value
78+
prior to storing. If a chunk is uniformly equal to the fill value, then
79+
that chunk is not be stored, and the store entry for that chunk's key
80+
is deleted. This setting enables sparser storage, as only chunks with
8181
non-fill-value data are stored, at the expense of overhead associated
8282
with checking the data of each chunk.
8383
.. versionadded:: 2.11
@@ -391,7 +391,7 @@ def open_array(
391391
chunk_store=None,
392392
storage_options=None,
393393
partial_decompress=False,
394-
write_empty_chunks=False,
394+
write_empty_chunks=True,
395395
**kwargs
396396
):
397397
"""Open an array using file-mode-like semantics.
@@ -447,11 +447,11 @@ def open_array(
447447
is Blosc, when getting data from the array chunks will be partially
448448
read and decompressed when possible.
449449
write_empty_chunks : bool, optional
450-
If True, all chunks will be stored regardless of their contents. If
451-
False (default), each chunk is compared to the array's fill value prior
452-
to storing. If a chunk is uniformly equal to the fill value, then that
453-
chunk is not be stored, and the store entry for that chunk's key is
454-
deleted. This setting enables sparser storage, as only chunks with
450+
If True (default), all chunks will be stored regardless of their
451+
contents. If False, each chunk is compared to the array's fill value
452+
prior to storing. If a chunk is uniformly equal to the fill value, then
453+
that chunk is not be stored, and the store entry for that chunk's key
454+
is deleted. This setting enables sparser storage, as only chunks with
455455
non-fill-value data are stored, at the expense of overhead associated
456456
with checking the data of each chunk.
457457
.. versionadded:: 2.11

0 commit comments

Comments
 (0)