Skip to content

Commit

Permalink
clean up types and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
d-v-b committed Dec 10, 2024
1 parent 7e83580 commit 00d74f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/zarr/api/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ async def create(
meta_array: Any | None = None, # TODO: need type
attributes: dict[str, JSON] | None = None,
# v3 only
chunk_shape: tuple[int, ...] | int | None = None,
chunk_shape: ChunkCoords | int | None = None,
chunk_key_encoding: (
ChunkKeyEncoding
| tuple[Literal["default"], Literal[".", "/"]]
Expand Down Expand Up @@ -1095,6 +1095,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
8 changes: 7 additions & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,12 @@ def test_derived_docstrings(func_name: str) -> None:
Test that functions in the synchronous API module have
docstrings that are derived from those in the asynchronous API module
"""
if func_name in ("open_array",):
msg = (
'"open_array" gets xfailed because the async version and the sync '
"version have meaningful differences in their docstrings."
)
pytest.xfail(reason=msg)
assert (
getattr(zarr.api.synchronous, func_name).__doc__
== getattr(zarr.api.asynchronous, func_name).__doc__
Expand All @@ -1075,7 +1081,7 @@ def test_derived_signatures(func_name: str) -> None:
"""
Test that functions in the API module have signatures that are derived from those in the asynchronous API module
"""
if func_name in ("tree", "load", "open", "open_array"):
if func_name in ("tree", "load", "open", "open_array", "group"):
msg = (
f"{func_name} gets xfailed because the async version and the sync "
"version have meaningful differences in their signatures."
Expand Down

0 comments on commit 00d74f4

Please sign in to comment.