Skip to content

Commit 9c259d2

Browse files
authored
Merge pull request #15 from maxrjones/obstore-remote-docs
Add S3 example for ObjectStore
2 parents 8c3a6f2 + 35a9819 commit 9c259d2

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

changes/1661.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add experimental ObjectStore storage class based on obstore.

docs/user-guide/storage.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,23 @@ builds on the production quality Rust library `object_store <https://docs.rs/obj
116116
>>> zarr.create_array(store=store, shape=(2,), dtype='float64')
117117
<Array object://... shape=(2,) dtype=float64>
118118

119+
Here's an example of using ObjectStore for accessing remote data:
120+
121+
>>> from zarr.storage import ObjectStore
122+
>>> from obstore.store import S3Store
123+
>>>
124+
>>> s3_store = S3Store('noaa-nwm-retro-v2-zarr-pds', skip_signature=True, region="us-west-2")
125+
>>> store = zarr.storage.ObjectStore(store=s3_store, read_only=True)
126+
>>> group = zarr.open_group(store=store, mode='r')
127+
>>> group.info
128+
Name :
129+
Type : Group
130+
Zarr format : 2
131+
Read-only : True
132+
Store type : ObjectStore
133+
No. members : 12
134+
No. arrays : 12
135+
No. groups : 0
119136

120137
.. warning::
121138
The :class:`zarr.storage.ObjectStore` class is experimental.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ run-hypothesis = "run-coverage --hypothesis-profile ci --run-slow-hypothesis tes
166166
list-env = "pip list"
167167

168168
[tool.hatch.envs.doctest]
169-
features = ["test", "optional"]
169+
features = ["test", "optional", "remote"]
170170
description = "Test environment for doctests"
171171

172172
[tool.hatch.envs.doctest.scripts]

0 commit comments

Comments
 (0)