Skip to content

Commit 952c64b

Browse files
committed
remove references to private API
1 parent 4b12879 commit 952c64b

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

changes/3299.bugfix.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
Fix a bug in ``create_array`` caused by iterating over chunk-aligned regions instead of
2-
shard-aligned regions when writing data. To make the distinction between chunks and shards more
3-
obvious in the ``Array`` API, new properties ``chunk_grid_shape``,
4-
``shard_grid_shape``, ``nshards``, ``nshards_initialized`` were added to the ``Array`` class.
5-
Additionally, the behavior of ``nchunks_initialized`` has been adjusted. This function consistently
6-
reports the number of chunks present in stored objects, even when the array uses the sharding codec.
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.

docs/user-guide/performance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ the time required to write an array with different values.::
211211
... start = time.time()
212212
... arr[:] = value
213213
... elapsed = time.time() - start
214-
... result.append((elapsed, arr.nshards_initialized))
214+
... result.append((elapsed, arr.nchunks_initialized))
215215
... return result
216216
... # log results
217217
>>> for write_empty_chunks in (True, False):

src/zarr/core/array.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,6 @@ async def nchunks_initialized(self) -> int:
12751275
>>> await arr.nchunks_initialized()
12761276
0
12771277
>>> await arr.setitem(slice(5), 1)
1278-
>>> await arr.nshards_initialized()
1279-
3
12801278
>>> await arr.nchunks_initialized()
12811279
6
12821280
"""
@@ -1302,15 +1300,15 @@ async def _nshards_initialized(self) -> int:
13021300
Notes
13031301
-----
13041302
On :class:`AsyncArray` this is an asynchronous method, unlike the (synchronous)
1305-
property :attr:`Array.nshards_initialized`.
1303+
property :attr:`Array._nshards_initialized`.
13061304
13071305
Examples
13081306
--------
13091307
>>> arr = await zarr.api.asynchronous.create(shape=(10,), chunks=(2,))
1310-
>>> await arr.nshards_initialized()
1308+
>>> await arr._nshards_initialized()
13111309
0
13121310
>>> await arr.setitem(slice(5), 1)
1313-
>>> await arr.nshards_initialized()
1311+
>>> await arr._nshards_initialized()
13141312
3
13151313
"""
13161314
return len(await _shards_initialized(self))
@@ -2469,8 +2467,6 @@ def nchunks_initialized(self) -> int:
24692467
>>> arr.nchunks_initialized
24702468
0
24712469
>>> arr[:5] = 1
2472-
>>> arr.nshards_initialized
2473-
3
24742470
>>> arr.nchunks_initialized
24752471
6
24762472
"""
@@ -2490,10 +2486,10 @@ def _nshards_initialized(self) -> int:
24902486
Examples
24912487
--------
24922488
>>> arr = await zarr.create(shape=(10,), chunks=(2,))
2493-
>>> arr.nshards_initialized
2489+
>>> arr._nshards_initialized
24942490
0
24952491
>>> arr[:5] = 1
2496-
>>> arr.nshard_initialized
2492+
>>> arr._nshard_initialized
24972493
3
24982494
"""
24992495
return sync(self._async_array._nshards_initialized())

0 commit comments

Comments
 (0)