Skip to content

Commit 959fbcf

Browse files
committed
improves logic readability
1 parent 66dfa41 commit 959fbcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zarr/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ def _get_selection(self, indexer, out=None, fields=None):
10211021

10221022
# iterate over chunks
10231023
if not hasattr(self.chunk_store, "getitems") or \
1024-
not all(map(lambda x: x != 0, self.shape)):
1024+
any(map(lambda x: x == 0, self.shape)):
10251025
# sequentially get one key at a time from storage
10261026
for chunk_coords, chunk_selection, out_selection in indexer:
10271027

@@ -1537,7 +1537,7 @@ def _set_selection(self, indexer, value, fields=None):
15371537

15381538
# iterate over chunks in range
15391539
if not hasattr(self.store, "setitems") or self._synchronizer is not None \
1540-
or not all(map(lambda x: x != 0, self.shape)):
1540+
or any(map(lambda x: x == 0, self.shape)):
15411541
# iterative approach
15421542
for chunk_coords, chunk_selection, out_selection in indexer:
15431543

0 commit comments

Comments
 (0)