Skip to content

Commit

Permalink
docs/add docstrings to synchronous API (zarr-developers#2549)
Browse files Browse the repository at this point in the history
* add docstrings and complete function signatures to synchronous api, and tests for the above

* clean up types and docstrings

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* Update src/zarr/api/synchronous.py

Co-authored-by: Joe Hamman <[email protected]>

* remove doomed docstring tests

* allow bool in create

---------

Co-authored-by: Joe Hamman <[email protected]>
  • Loading branch information
d-v-b and jhamman authored Dec 18, 2024
1 parent 4455726 commit f035d45
Show file tree
Hide file tree
Showing 5 changed files with 652 additions and 71 deletions.
8 changes: 5 additions & 3 deletions src/zarr/api/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,9 +774,9 @@ async def open_group(


async def create(
shape: ChunkCoords,
shape: ChunkCoords | int,
*, # Note: this is a change from v2
chunks: ChunkCoords | None = None, # TODO: v2 allowed chunks=True
chunks: ChunkCoords | int | None = None, # TODO: v2 allowed chunks=True
dtype: npt.DTypeLike | None = None,
compressor: dict[str, JSON] | None = None, # TODO: default and type change
fill_value: Any | None = 0, # TODO: need type
Expand All @@ -798,7 +798,7 @@ async def create(
meta_array: Any | None = None, # TODO: need type
attributes: dict[str, JSON] | None = None,
# v3 only
chunk_shape: ChunkCoords | None = None,
chunk_shape: ChunkCoords | int | None = None,
chunk_key_encoding: (
ChunkKeyEncoding
| tuple[Literal["default"], Literal[".", "/"]]
Expand Down Expand Up @@ -1104,6 +1104,8 @@ async def open_array(
----------
store : Store or str
Store or path to directory in file system or name of zip file.
zarr_version : {2, 3, None}, optional
The zarr format to use when saving. Deprecated in favor of zarr_format.
zarr_format : {2, 3, None}, optional
The zarr format to use when saving.
path : str, optional
Expand Down
Loading

0 comments on commit f035d45

Please sign in to comment.