Skip to content

Commit ab8c1d3

Browse files
committed
link all StoreLike refs to the user guide
1 parent 6e0bccd commit ab8c1d3

File tree

6 files changed

+111
-59
lines changed

6 files changed

+111
-59
lines changed

docs/user-guide/storage.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ print(group)
4545

4646
`StoreLike` values can be:
4747

48-
- a `Path` or string indicating a [local store](#local-store) location e.g.:
48+
- a `Path` or string indicating a location on the local file system.
49+
This will create a [local store](#local-store):
4950
```python exec="true" session="storage" source="above" result="ansi"
5051
group = zarr.open_group(store='data/foo/bar')
5152
print(group)
@@ -56,7 +57,7 @@ print(group)
5657
print(group)
5758
```
5859

59-
- an FSSpec URI string, indicating a [remote store](#remote-store) location e.g.:
60+
- an FSSpec URI string, indicating a [remote store](#remote-store) location:
6061
```python exec="true" session="storage" source="above" result="ansi"
6162
group = zarr.open_group(
6263
store='s3://noaa-nwm-retro-v2-zarr-pds',
@@ -76,8 +77,9 @@ print(group)
7677
print(group)
7778
```
7879

79-
- a dictionary of string to [`Buffer`][zarr.abc.buffer.Buffer] mappings, which
80-
will create a [memory store](#memory-store).
80+
- a dictionary of string to [`Buffer`][zarr.abc.buffer.Buffer] mappings. This will
81+
create a [memory store](#memory-store), using this dictionary as the
82+
[`store_dict` argument][zarr.storage.MemoryStore].
8183

8284
- an FSSpec [FSMap object](https://filesystem-spec.readthedocs.io/en/latest/api.html#fsspec.FSMap),
8385
which will create an [FsspecStore](#remote-store).

src/zarr/api/asynchronous.py

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ async def consolidate_metadata(
199199
Parameters
200200
----------
201201
store : StoreLike
202-
The store-like object whose metadata you wish to consolidate.
202+
The store-like object whose metadata you wish to consolidate. See the
203+
[storage documentation in the user guide][user-guide-store-like]
204+
for a description of all valid StoreLike values.
203205
path : str, optional
204206
A path to a group in the store to consolidate at. Only children
205207
below that group will be consolidated.
@@ -293,7 +295,9 @@ async def load(
293295
Parameters
294296
----------
295297
store : StoreLike
296-
Store or path to directory in file system or name of zip file.
298+
StoreLike object to open. See the
299+
[storage documentation in the user guide][user-guide-store-like]
300+
for a description of all valid StoreLike values.
297301
path : str or None, optional
298302
The path within the store from which to load.
299303
@@ -337,7 +341,9 @@ async def open(
337341
Parameters
338342
----------
339343
store : StoreLike or None, default=None
340-
Store or path to directory in file system or name of zip file.
344+
StoreLike object to open. See the
345+
[storage documentation in the user guide][user-guide-store-like]
346+
for a description of all valid StoreLike values.
341347
mode : {'r', 'r+', 'a', 'w', 'w-'}, optional
342348
Persistence mode: 'r' means read only (must exist); 'r+' means
343349
read/write (must exist); 'a' means read/write (create if doesn't
@@ -421,7 +427,9 @@ async def save(
421427
Parameters
422428
----------
423429
store : StoreLike
424-
Store or path to directory in file system or name of zip file.
430+
StoreLike object to open. See the
431+
[storage documentation in the user guide][user-guide-store-like]
432+
for a description of all valid StoreLike values.
425433
*args : ndarray
426434
NumPy arrays with data to save.
427435
zarr_format : {2, 3, None}, optional
@@ -457,7 +465,9 @@ async def save_array(
457465
Parameters
458466
----------
459467
store : StoreLike
460-
Store or path to directory in file system or name of zip file.
468+
StoreLike object to open. See the
469+
[storage documentation in the user guide][user-guide-store-like]
470+
for a description of all valid StoreLike values.
461471
arr : ndarray
462472
NumPy array with data to save.
463473
zarr_format : {2, 3, None}, optional
@@ -513,7 +523,9 @@ async def save_group(
513523
Parameters
514524
----------
515525
store : StoreLike
516-
Store or path to directory in file system or name of zip file.
526+
StoreLike object to open. See the
527+
[storage documentation in the user guide][user-guide-store-like]
528+
for a description of all valid StoreLike values.
517529
*args : ndarray
518530
NumPy arrays with data to save.
519531
zarr_format : {2, 3, None}, optional
@@ -662,7 +674,9 @@ async def group(
662674
Parameters
663675
----------
664676
store : StoreLike or None, default=None
665-
Store or path to directory in file system or name of zip file.
677+
StoreLike object to open. See the
678+
[storage documentation in the user guide][user-guide-store-like]
679+
for a description of all valid StoreLike values.
666680
overwrite : bool, optional
667681
If True, delete any pre-existing data in `store` at `path` before
668682
creating the group.
@@ -724,7 +738,9 @@ async def create_group(
724738
Parameters
725739
----------
726740
store : StoreLike
727-
Store or path to directory in file system or name of zip file.
741+
StoreLike object to open. See the
742+
[storage documentation in the user guide][user-guide-store-like]
743+
for a description of all valid StoreLike values.
728744
path : str, optional
729745
Group path within store.
730746
overwrite : bool, optional
@@ -780,17 +796,9 @@ async def open_group(
780796
Parameters
781797
----------
782798
store : StoreLike or None, default=None
783-
Store or path to directory in file system or name of zip file.
784-
785-
Strings are interpreted as paths on the local file system
786-
and used as the ``root`` argument to [zarr.storage.LocalStore][].
787-
788-
Dictionaries are used as the ``store_dict`` argument in
789-
[zarr.storage.MemoryStore][].
790-
791-
By default (``store=None``) a new [zarr.storage.MemoryStore][]
792-
is created.
793-
799+
StoreLike object to open. See the
800+
[storage documentation in the user guide][user-guide-store-like]
801+
for a description of all valid StoreLike values.
794802
mode : {'r', 'r+', 'a', 'w', 'w-'}, optional
795803
Persistence mode: 'r' means read only (must exist); 'r+' means
796804
read/write (must exist); 'a' means read/write (create if doesn't
@@ -805,7 +813,9 @@ async def open_group(
805813
path : str, optional
806814
Group path within store.
807815
chunk_store : StoreLike or None, default=None
808-
Store or path to directory in file system or name of zip file.
816+
Separate storage for chunks. See the
817+
[storage documentation in the user guide][user-guide-store-like]
818+
for a description of all valid StoreLike values.
809819
storage_options : dict
810820
If using an fsspec URL to create the store, these will be passed to
811821
the backend implementation. Ignored otherwise.
@@ -939,7 +949,9 @@ async def create(
939949
Memory layout to be used within each chunk.
940950
If not specified, the ``array.order`` parameter in the global config will be used.
941951
store : StoreLike or None, default=None
942-
Store or path to directory in file system or name of zip file.
952+
StoreLike object to open. See the
953+
[storage documentation in the user guide][user-guide-store-like]
954+
for a description of all valid StoreLike values.
943955
synchronizer : object, optional
944956
Array synchronizer.
945957
overwrite : bool, optional
@@ -1250,7 +1262,9 @@ async def open_array(
12501262
Parameters
12511263
----------
12521264
store : StoreLike
1253-
Store or path to directory in file system or name of zip file.
1265+
StoreLike object to open. See the
1266+
[storage documentation in the user guide][user-guide-store-like]
1267+
for a description of all valid StoreLike values.
12541268
zarr_version : {2, 3, None}, optional
12551269
The zarr format to use when saving. Deprecated in favor of zarr_format.
12561270
zarr_format : {2, 3, None}, optional

src/zarr/api/synchronous.py

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def consolidate_metadata(
8888
Parameters
8989
----------
9090
store : StoreLike
91-
The store-like object whose metadata you wish to consolidate.
91+
The store-like object whose metadata you wish to consolidate. See the
92+
[storage documentation in the user guide][user-guide-store-like]
93+
for a description of all valid StoreLike values.
9294
path : str, optional
9395
A path to a group in the store to consolidate at. Only children
9496
below that group will be consolidated.
@@ -143,7 +145,9 @@ def load(
143145
Parameters
144146
----------
145147
store : StoreLike
146-
Store or path to directory in file system or name of zip file.
148+
StoreLike object to open. See the
149+
[storage documentation in the user guide][user-guide-store-like]
150+
for a description of all valid StoreLike values.
147151
path : str or None, optional
148152
The path within the store from which to load.
149153
@@ -247,7 +251,9 @@ def save(
247251
Parameters
248252
----------
249253
store : StoreLike
250-
Store or path to directory in file system or name of zip file.
254+
StoreLike object to open. See the
255+
[storage documentation in the user guide][user-guide-store-like]
256+
for a description of all valid StoreLike values.
251257
*args : ndarray
252258
NumPy arrays with data to save.
253259
zarr_format : {2, 3, None}, optional
@@ -281,7 +287,9 @@ def save_array(
281287
Parameters
282288
----------
283289
store : StoreLike
284-
Store or path to directory in file system or name of zip file.
290+
StoreLike object to open. See the
291+
[storage documentation in the user guide][user-guide-store-like]
292+
for a description of all valid StoreLike values.
285293
arr : ndarray
286294
NumPy array with data to save.
287295
zarr_format : {2, 3, None}, optional
@@ -324,7 +332,9 @@ def save_group(
324332
Parameters
325333
----------
326334
store : StoreLike
327-
Store or path to directory in file system or name of zip file.
335+
StoreLike object to open. See the
336+
[storage documentation in the user guide][user-guide-store-like]
337+
for a description of all valid StoreLike values.
328338
*args : ndarray
329339
NumPy arrays with data to save.
330340
zarr_format : {2, 3, None}, optional
@@ -415,7 +425,9 @@ def group(
415425
Parameters
416426
----------
417427
store : StoreLike or None, default=None
418-
Store or path to directory in file system or name of zip file.
428+
StoreLike object to open. See the
429+
[storage documentation in the user guide][user-guide-store-like]
430+
for a description of all valid StoreLike values.
419431
overwrite : bool, optional
420432
If True, delete any pre-existing data in `store` at `path` before
421433
creating the group.
@@ -482,17 +494,9 @@ def open_group(
482494
Parameters
483495
----------
484496
store : StoreLike or None, default=None
485-
Store or path to directory in file system or name of zip file.
486-
487-
Strings are interpreted as paths on the local file system
488-
and used as the ``root`` argument to [zarr.storage.LocalStore][].
489-
490-
Dictionaries are used as the ``store_dict`` argument in
491-
[zarr.storage.MemoryStore][].
492-
493-
By default (``store=None``) a new [zarr.storage.MemoryStore][]
494-
is created.
495-
497+
StoreLike object to open. See the
498+
[storage documentation in the user guide][user-guide-store-like]
499+
for a description of all valid StoreLike values.
496500
mode : {'r', 'r+', 'a', 'w', 'w-'}, optional
497501
Persistence mode: 'r' means read only (must exist); 'r+' means
498502
read/write (must exist); 'a' means read/write (create if doesn't
@@ -507,7 +511,9 @@ def open_group(
507511
path : str, optional
508512
Group path within store.
509513
chunk_store : StoreLike or None, default=None
510-
Store or path to directory in file system or name of zip file.
514+
Separate storage for chunks. See the
515+
[storage documentation in the user guide][user-guide-store-like]
516+
for a description of all valid StoreLike values.
511517
storage_options : dict
512518
If using an fsspec URL to create the store, these will be passed to
513519
the backend implementation. Ignored otherwise.
@@ -572,7 +578,9 @@ def create_group(
572578
Parameters
573579
----------
574580
store : StoreLike
575-
Store or path to directory in file system or name of zip file.
581+
StoreLike object to open. See the
582+
[storage documentation in the user guide][user-guide-store-like]
583+
for a description of all valid StoreLike values.
576584
path : str, optional
577585
Group path within store.
578586
overwrite : bool, optional
@@ -674,7 +682,9 @@ def create(
674682
Memory layout to be used within each chunk.
675683
If not specified, the ``array.order`` parameter in the global config will be used.
676684
store : StoreLike or None, default=None
677-
Store or path to directory in file system or name of zip file.
685+
StoreLike object to open. See the
686+
[storage documentation in the user guide][user-guide-store-like]
687+
for a description of all valid StoreLike values.
678688
synchronizer : object, optional
679689
Array synchronizer.
680690
overwrite : bool, optional
@@ -834,7 +844,9 @@ def create_array(
834844
Parameters
835845
----------
836846
store : StoreLike
837-
Store or path to directory in file system or name of zip file.
847+
StoreLike object to open. See the
848+
[storage documentation in the user guide][user-guide-store-like]
849+
for a description of all valid StoreLike values.
838850
name : str or None, optional
839851
The name of the array within the store. If ``name`` is ``None``, the array will be located
840852
at the root of the store.
@@ -998,7 +1010,9 @@ def from_array(
9981010
Parameters
9991011
----------
10001012
store : StoreLike
1001-
Store or path to directory in file system or name of zip file.
1013+
StoreLike object to open. See the
1014+
[storage documentation in the user guide][user-guide-store-like]
1015+
for a description of all valid StoreLike values.
10021016
data : Array | array-like
10031017
The array to copy.
10041018
write_data : bool, default True
@@ -1335,7 +1349,9 @@ def open_array(
13351349
Parameters
13361350
----------
13371351
store : StoreLike
1338-
Store or path to directory in file system or name of zip file.
1352+
StoreLike object to open. See the
1353+
[storage documentation in the user guide][user-guide-store-like]
1354+
for a description of all valid StoreLike values.
13391355
zarr_version : {2, 3, None}, optional
13401356
The zarr format to use when saving. Deprecated in favor of zarr_format.
13411357
zarr_format : {2, 3, None}, optional

src/zarr/core/array.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,9 @@ async def create(
499499
Parameters
500500
----------
501501
store : StoreLike
502-
The store where the array will be created.
502+
The store where the array will be created. See the
503+
[storage documentation in the user guide][user-guide-store-like]
504+
for a description of all valid StoreLike values.
503505
shape : ShapeLike
504506
The shape of the array.
505507
dtype : ZDTypeLike
@@ -967,7 +969,9 @@ async def open(
967969
Parameters
968970
----------
969971
store : StoreLike
970-
The store containing the Zarr array.
972+
The store containing the Zarr array. See the
973+
[storage documentation in the user guide][user-guide-store-like]
974+
for a description of all valid StoreLike values.
971975
zarr_format : ZarrFormat | None, optional
972976
The Zarr format version (default is 3).
973977
@@ -2033,7 +2037,9 @@ def create(
20332037
Parameters
20342038
----------
20352039
store : StoreLike
2036-
The array store that has already been initialized.
2040+
The array store that has already been initialized. See the
2041+
[storage documentation in the user guide][user-guide-store-like]
2042+
for a description of all valid StoreLike values.
20372043
shape : tuple[int, ...]
20382044
The shape of the array.
20392045
dtype : ZDTypeLike
@@ -2233,7 +2239,9 @@ def open(
22332239
Parameters
22342240
----------
22352241
store : StoreLike
2236-
Store containing the Array.
2242+
Store containing the Array. See the
2243+
[storage documentation in the user guide][user-guide-store-like]
2244+
for a description of all valid StoreLike values.
22372245
22382246
Returns
22392247
-------
@@ -4251,7 +4259,9 @@ async def from_array(
42514259
Parameters
42524260
----------
42534261
store : StoreLike
4254-
Store or path to directory in file system or name of zip file.
4262+
StoreLike object to open. See the
4263+
[storage documentation in the user guide][user-guide-store-like]
4264+
for a description of all valid StoreLike values.
42554265
data : Array | array-like
42564266
The array to copy.
42574267
write_data : bool, default True
@@ -4735,7 +4745,9 @@ async def create_array(
47354745
Parameters
47364746
----------
47374747
store : StoreLike
4738-
Store or path to directory in file system or name of zip file.
4748+
StoreLike object to open. See the
4749+
[storage documentation in the user guide][user-guide-store-like]
4750+
for a description of all valid StoreLike values.
47394751
name : str or None, optional
47404752
The name of the array within the store. If ``name`` is ``None``, the array will be located
47414753
at the root of the store.

0 commit comments

Comments
 (0)