Skip to content

Commit e826940

Browse files
committed
update docstrings
1 parent e9f414b commit e826940

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/zarr/testing/store.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,22 +347,41 @@ def __init__(self, cls: Store, *, get_latency: float = 0, set_latency: float = 0
347347
self._store = cls
348348

349349
async def set(self, key: str, value: Buffer) -> None:
350+
"""
351+
Add latency to the ``set`` method.
352+
353+
Calls ``asyncio.sleep(self.set_latency)`` before invoking the wrapped ``set`` method.
354+
355+
Parameters
356+
----------
357+
key : str
358+
The key to set
359+
value : Buffer
360+
The value to set
361+
362+
Returns
363+
-------
364+
None
365+
"""
350366
await asyncio.sleep(self.set_latency)
351367
await self._store.set(key, value)
352368

353369
async def get(
354370
self, key: str, prototype: BufferPrototype, byte_range: ByteRangeRequest | None = None
355371
) -> Buffer | None:
356372
"""
357-
Add latency to the get method.
373+
Add latency to the ``get`` method.
358374
359-
Adds a sleep of `self.get_latency` seconds before calling the wrapped method.
375+
Calls ``asyncio.sleep(self.get_latency)`` before invoking the wrapped ``get`` method.
360376
361377
Parameters
362378
----------
363379
key : str
380+
The key to get
364381
prototype : BufferPrototype
382+
The BufferPrototype to use.
365383
byte_range : ByteRangeRequest, optional
384+
An optional byte range.
366385
367386
Returns
368387
-------

0 commit comments

Comments
 (0)