Skip to content

Commit ec2c359

Browse files
authored
docs: say save/save_array/save_group write to a store, not the local file system (#4520)
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.
1 parent bd0dc84 commit ec2c359

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎changes/4520.doc.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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.

‎src/zarr/api/asynchronous.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ async def save(
457457
storage_options: dict[str, Any] | None = None,
458458
**kwargs: Any, # TODO: type kwargs as valid args to save
459459
) -> None:
460-
"""Convenience function to save an array or group of arrays to the local file system.
460+
"""Convenience function to save an array or group of arrays to a store.
461461
462462
Parameters
463463
----------
@@ -504,7 +504,7 @@ async def save_array(
504504
storage_options: dict[str, Any] | None = None,
505505
**kwargs: Any, # TODO: type kwargs as valid args to create
506506
) -> None:
507-
"""Convenience function to save a NumPy array to the local file system, following a
507+
"""Convenience function to save a NumPy array to a store, following a
508508
similar API to the NumPy save() function.
509509
510510
Parameters
@@ -559,7 +559,7 @@ async def save_group(
559559
storage_options: dict[str, Any] | None = None,
560560
**kwargs: NDArrayLike,
561561
) -> None:
562-
"""Convenience function to save several NumPy arrays to the local file system, following a
562+
"""Convenience function to save several NumPy arrays to a store, following a
563563
similar API to the NumPy savez()/savez_compressed() functions.
564564
565565
Parameters

‎src/zarr/api/synchronous.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def save(
263263
storage_options: dict[str, Any] | None = None,
264264
**kwargs: Any, # TODO: type kwargs as valid args to async_api.save
265265
) -> None:
266-
"""Save an array or group of arrays to the local file system.
266+
"""Save an array or group of arrays to a store.
267267
268268
Parameters
269269
----------
@@ -304,7 +304,7 @@ def save_array(
304304
storage_options: dict[str, Any] | None = None,
305305
**kwargs: Any, # TODO: type kwargs as valid args to async_api.save_array
306306
) -> None:
307-
"""Save a NumPy array to the local file system.
307+
"""Save a NumPy array to a store.
308308
309309
Follows a similar API to the NumPy save() function.
310310
@@ -347,7 +347,7 @@ def save_group(
347347
storage_options: dict[str, Any] | None = None,
348348
**kwargs: NDArrayLike,
349349
) -> None:
350-
"""Save several NumPy arrays to the local file system.
350+
"""Save several NumPy arrays to a store.
351351
352352
Follows a similar API to the NumPy savez()/savez_compressed() functions.
353353

0 commit comments

Comments
 (0)