From f3ec4fe23a72e356e06fd482271cf3b717956c1e Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Sat, 17 Oct 2026 03:32:10 +0000 Subject: [PATCH] docs: say save/save_array/save_group write to a store, not the local file system The three docstrings, inherited from Zarr 2, opened with "to the local file system". The functions take a StoreLike and a storage_options argument, and work with every store the library supports. The wording was being read as a design limitation of the functions (see the discussion in #3976), which it is not. --- changes/4520.doc.md | 1 + src/zarr/api/asynchronous.py | 6 +++--- src/zarr/api/synchronous.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 changes/4520.doc.md diff --git a/changes/4520.doc.md b/changes/4520.doc.md new file mode 100644 index 0000000000..1c3ad1a06d --- /dev/null +++ b/changes/4520.doc.md @@ -0,0 +1 @@ +Correct the docstrings of `zarr.save`, `zarr.save_array` and `zarr.save_group` to say the functions write to any store. Previously the docstrings stated the functions wrote to only the local file system, which was inaccurate. diff --git a/src/zarr/api/asynchronous.py b/src/zarr/api/asynchronous.py index 5725b3d13a..39e7cdd9d4 100644 --- a/src/zarr/api/asynchronous.py +++ b/src/zarr/api/asynchronous.py @@ -457,7 +457,7 @@ async def save( storage_options: dict[str, Any] | None = None, **kwargs: Any, # TODO: type kwargs as valid args to save ) -> None: - """Convenience function to save an array or group of arrays to the local file system. + """Convenience function to save an array or group of arrays to a store. Parameters ---------- @@ -504,7 +504,7 @@ async def save_array( storage_options: dict[str, Any] | None = None, **kwargs: Any, # TODO: type kwargs as valid args to create ) -> None: - """Convenience function to save a NumPy array to the local file system, following a + """Convenience function to save a NumPy array to a store, following a similar API to the NumPy save() function. Parameters @@ -559,7 +559,7 @@ async def save_group( storage_options: dict[str, Any] | None = None, **kwargs: NDArrayLike, ) -> None: - """Convenience function to save several NumPy arrays to the local file system, following a + """Convenience function to save several NumPy arrays to a store, following a similar API to the NumPy savez()/savez_compressed() functions. Parameters diff --git a/src/zarr/api/synchronous.py b/src/zarr/api/synchronous.py index 524f719742..b383085bda 100644 --- a/src/zarr/api/synchronous.py +++ b/src/zarr/api/synchronous.py @@ -263,7 +263,7 @@ def save( storage_options: dict[str, Any] | None = None, **kwargs: Any, # TODO: type kwargs as valid args to async_api.save ) -> None: - """Save an array or group of arrays to the local file system. + """Save an array or group of arrays to a store. Parameters ---------- @@ -304,7 +304,7 @@ def save_array( storage_options: dict[str, Any] | None = None, **kwargs: Any, # TODO: type kwargs as valid args to async_api.save_array ) -> None: - """Save a NumPy array to the local file system. + """Save a NumPy array to a store. Follows a similar API to the NumPy save() function. @@ -347,7 +347,7 @@ def save_group( storage_options: dict[str, Any] | None = None, **kwargs: NDArrayLike, ) -> None: - """Save several NumPy arrays to the local file system. + """Save several NumPy arrays to a store. Follows a similar API to the NumPy savez()/savez_compressed() functions.