Skip to content

Commit c9eefe6

Browse files
d-v-bbojidar-bgdcherian
authored
fix chunk/shard iteration (#3299)
* factor array element iteration routines into stand-alone functions, and add a failing test * add shard_grid_shape, chunk_grid_shape Co-authored-by: Bojidar Marinov <[email protected]> * docstrings * handle null shards * use shard_grid_shape instead of cdata_shape in nchunks * add improved set of low-level iteration routines for arrays * correct deprecation message * check for deprecation warnings around iter_chunk_keys * plug tiny coverage holes * lint * rename chunks_initialized to shards_initialized * add nshards, nshards_initialized * fix doctests * remove iter_chunk_keys * make nchunks_initialized report the product of the number of shards and the number of chunks per shard * changelog * correct name of changelog entry * add test for unsharded data * add test for cdata_shape, shard_grid_shape, chunk_grid_shape * add nshards * expand nchunks_initialized test conditions * restore memorystore * expand test parametrization * unbreak tests * include asyncarray cdata_shape in test * make new API private * docstrings * remove references to private API * Update src/zarr/core/array.py Co-authored-by: Deepak Cherian <[email protected]> * Update src/zarr/core/indexing.py Co-authored-by: Deepak Cherian <[email protected]> * fix docstring --------- Co-authored-by: Bojidar Marinov <[email protected]> Co-authored-by: Deepak Cherian <[email protected]>
1 parent 9498336 commit c9eefe6

File tree

5 files changed

+865
-107
lines changed

5 files changed

+865
-107
lines changed

changes/3299.bugfix.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix a bug in ``create_array`` caused by iterating over chunk-aligned regions instead of
2+
shard-aligned regions when writing data. Additionally, the behavior of ``nchunks_initialized``
3+
has been adjusted. This function consistently reports the number of chunks present in stored objects,
4+
even when the array uses the sharding codec.

0 commit comments

Comments
 (0)