Skip to content

Commit c06467c

Browse files
committed
Remove re-export from __init__.py
1 parent 5cc3508 commit c06467c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

docs/user-guide/storage.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,22 @@ Object Store
103103
~~~~~~~~~~~~
104104

105105

106-
:class:`zarr.storage.ObjectStore` stores the contents of the Zarr hierarchy using any ObjectStore
106+
:class:`zarr.storage.obstore.ObjectStore` stores the contents of the Zarr hierarchy using any ObjectStore
107107
`storage implementation <https://developmentseed.org/obstore/latest/api/store/>`_, such as
108108
AWS S3, Google Cloud Storage, and Azure Blob Storage. This store is backed by `obstore <https://developmentseed.org/obstore/latest/>`_, which
109109
builds on the production quality Rust library `object_store <https://docs.rs/object_store/latest/object_store/>`_.
110110

111111

112+
>>> from zarr.storage.obstore import ObjectStore
112113
>>> from obstore.store import MemoryStore
113-
>>> store = zarr.storage.ObjectStore(MemoryStore())
114+
>>>
115+
>>> store = ObjectStore(MemoryStore())
114116
>>> zarr.create_array(store=store, shape=(2,), dtype='float64')
115117
<Array object://... shape=(2,) dtype=float64>
116118

117119

118120
.. warning::
119-
The :class:`zarr.storage.ObjectStore` class is experimental.
121+
The :class:`zarr.storage.obstore.ObjectStore` class is experimental.
120122

121123
.. _user-guide-custom-stores:
122124

src/zarr/storage/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from zarr.storage._local import LocalStore
99
from zarr.storage._logging import LoggingStore
1010
from zarr.storage._memory import GpuMemoryStore, MemoryStore
11-
from zarr.storage._object import ObjectStore
1211
from zarr.storage._wrapper import WrapperStore
1312
from zarr.storage._zip import ZipStore
1413

@@ -18,7 +17,6 @@
1817
"LocalStore",
1918
"LoggingStore",
2019
"MemoryStore",
21-
"ObjectStore",
2220
"StoreLike",
2321
"StorePath",
2422
"WrapperStore",

src/zarr/storage/_object.py renamed to src/zarr/storage/obstore.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pickle
66
from collections import defaultdict
77
from collections.abc import Iterable
8-
from typing import TYPE_CHECKING, Any, TypedDict, TypeVar
8+
from typing import TYPE_CHECKING, Any, TypedDict
99

1010
import obstore as obs
1111
from obstore.store import (
@@ -37,14 +37,14 @@
3737
from zarr.core.buffer import BufferPrototype
3838
from zarr.core.common import BytesLike
3939

40-
ALLOWED_EXCEPTIONS: tuple[type[Exception], ...] = (
40+
__all__ = ["ObjectStore"]
41+
42+
_ALLOWED_EXCEPTIONS: tuple[type[Exception], ...] = (
4143
FileNotFoundError,
4244
IsADirectoryError,
4345
NotADirectoryError,
4446
)
4547

46-
S = TypeVar("S", bound=Store)
47-
4848

4949
class ObjectStore(Store):
5050
"""A Zarr store that uses obstore for fast read/write from AWS, GCP, Azure.
@@ -175,7 +175,7 @@ async def get(
175175
return prototype.buffer.from_bytes(await resp.bytes_async()) # type: ignore[arg-type]
176176
else:
177177
raise ValueError(f"Unexpected byte_range, got {byte_range}")
178-
except ALLOWED_EXCEPTIONS:
178+
except _ALLOWED_EXCEPTIONS:
179179
return None
180180

181181
async def get_partial_values(

0 commit comments

Comments
 (0)