Skip to content

Commit 99d03ec

Browse files
committed
Merge remote-tracking branch 'origin/main' into warn-non-spec
2 parents c64049c + 77d0b11 commit 99d03ec

File tree

11 files changed

+68
-64
lines changed

11 files changed

+68
-64
lines changed

.github/workflows/releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
with:
5656
name: releases
5757
path: dist
58-
- uses: pypa/[email protected].2
58+
- uses: pypa/[email protected].3
5959
with:
6060
user: __token__
6161
password: ${{ secrets.pypi_password }}

docs/guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ Guide
44
.. toctree::
55
:maxdepth: 1
66

7+
whatsnew_v3
78
storage
89
consolidated_metadata

docs/guide/whatsnew_v3.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
What's new in v3
2+
================
3+
4+
This page gives an overview of major changes and additions in version 3.
5+
6+
7+
Dependencies
8+
------------
9+
- The new ``remote`` dependency group can be used to install a supported version of
10+
``fsspec``, required for remote data access.
11+
- The new ``gpu`` dependency group can be used to install a supported version of
12+
``cuda``, required for GPU functionality.
13+
- The ``jupyter`` optional dependency group has been removed, since v3 contains no
14+
jupyter specific functionality.

docs/release.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ Dependency Changes
3939
fsspec and any relevant implementations (e.g. s3fs) before using the ``RemoteStore``.
4040
By :user:`Joe Hamman <jhamman>` :issue:`2391`.
4141

42+
* ``RemoteStore`` was renamed to ``FsspecStore``.
43+
By :user:`Joe Hamman <jhamman>` :issue:`2557`.
4244

4345
.. release_3.0.0-alpha:
4446

pyproject.toml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,14 @@ license = {text = "MIT License"}
5353
keywords = ["Python", "compressed", "ndimensional-arrays", "zarr"]
5454

5555
[project.optional-dependencies]
56-
fsspec = [
56+
# User extras
57+
remote = [
5758
"fsspec>=2023.10.0",
5859
]
60+
gpu = [
61+
"cupy-cuda12x",
62+
]
63+
# Development extras
5964
test = [
6065
"coverage",
6166
"pytest",
@@ -68,15 +73,7 @@ test = [
6873
"hypothesis",
6974
"universal-pathlib",
7075
]
71-
72-
jupyter = [
73-
'notebook',
74-
'ipytree>=0.2.2',
75-
'ipywidgets>=8.0.0',
76-
]
77-
gpu = [
78-
"cupy-cuda12x",
79-
]
76+
optional = ["rich", "universal-pathlib"]
8077
docs = [
8178
'sphinx==8.1.3',
8279
'sphinx-autobuild>=2021.3.14',
@@ -87,19 +84,9 @@ docs = [
8784
'pydata-sphinx-theme',
8885
'numpydoc',
8986
'numcodecs[msgpack]',
90-
'msgpack',
91-
]
92-
extra = [
93-
'msgpack',
94-
]
95-
optional = [
96-
'universal-pathlib>=0.0.22',
97-
'rich'
98-
]
99-
tree = [
100-
'rich',
10187
]
10288

89+
10390
[project.urls]
10491
"Bug Tracker" = "https://github.com/zarr-developers/zarr-python/issues"
10592
Changelog = "https://zarr.readthedocs.io/en/stable/release.html"
@@ -129,7 +116,7 @@ dependencies = [
129116
"numpy~={matrix:numpy}",
130117
"universal_pathlib",
131118
]
132-
features = ["test", "extra"]
119+
features = ["test"]
133120

134121
[[tool.hatch.envs.test.matrix]]
135122
python = ["3.11", "3.12", "3.13"]
@@ -160,7 +147,7 @@ dependencies = [
160147
"numpy~={matrix:numpy}",
161148
"universal_pathlib",
162149
]
163-
features = ["test", "extra", "gpu"]
150+
features = ["test", "gpu"]
164151

165152
[[tool.hatch.envs.gputest.matrix]]
166153
python = ["3.11", "3.12", "3.13"]

src/zarr/storage/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
from zarr.storage.common import StoreLike, StorePath, make_store_path
2+
from zarr.storage.fsspec import FsspecStore
23
from zarr.storage.local import LocalStore
34
from zarr.storage.logging import LoggingStore
45
from zarr.storage.memory import MemoryStore
5-
from zarr.storage.remote import RemoteStore
66
from zarr.storage.wrapper import WrapperStore
77
from zarr.storage.zip import ZipStore
88

99
__all__ = [
10+
"FsspecStore",
1011
"LocalStore",
1112
"LoggingStore",
1213
"MemoryStore",
13-
"RemoteStore",
1414
"StoreLike",
1515
"StorePath",
1616
"WrapperStore",

src/zarr/storage/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ async def make_store_path(
281281
TypeError
282282
If the StoreLike object is not one of the supported types.
283283
"""
284-
from zarr.storage.remote import RemoteStore # circular import
284+
from zarr.storage.fsspec import FsspecStore # circular import
285285

286286
used_storage_options = False
287287
path_normalized = normalize_path(path)
@@ -302,7 +302,7 @@ async def make_store_path(
302302

303303
if _is_fsspec_uri(store_like):
304304
used_storage_options = True
305-
store = RemoteStore.from_url(
305+
store = FsspecStore.from_url(
306306
store_like, storage_options=storage_options, read_only=_read_only
307307
)
308308
else:

src/zarr/storage/remote.py renamed to src/zarr/storage/fsspec.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
)
2323

2424

25-
class RemoteStore(Store):
25+
class FsspecStore(Store):
2626
"""
2727
A remote Store based on FSSpec
2828
@@ -61,8 +61,8 @@ class RemoteStore(Store):
6161
6262
See Also
6363
--------
64-
RemoteStore.from_upath
65-
RemoteStore.from_url
64+
FsspecStore.from_upath
65+
FsspecStore.from_url
6666
"""
6767

6868
# based on FSSpec
@@ -96,17 +96,17 @@ def __init__(
9696
if "://" in path and not path.startswith("http"):
9797
# `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯)
9898
scheme, _ = path.split("://", maxsplit=1)
99-
raise ValueError(f"path argument to RemoteStore must not include scheme ({scheme}://)")
99+
raise ValueError(f"path argument to FsspecStore must not include scheme ({scheme}://)")
100100

101101
@classmethod
102102
def from_upath(
103103
cls,
104104
upath: Any,
105105
read_only: bool = False,
106106
allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS,
107-
) -> RemoteStore:
107+
) -> FsspecStore:
108108
"""
109-
Create a RemoteStore from an upath object.
109+
Create a FsspecStore from an upath object.
110110
111111
Parameters
112112
----------
@@ -120,7 +120,7 @@ def from_upath(
120120
121121
Returns
122122
-------
123-
RemoteStore
123+
FsspecStore
124124
"""
125125
return cls(
126126
fs=upath.fs,
@@ -136,9 +136,9 @@ def from_url(
136136
storage_options: dict[str, Any] | None = None,
137137
read_only: bool = False,
138138
allowed_exceptions: tuple[type[Exception], ...] = ALLOWED_EXCEPTIONS,
139-
) -> RemoteStore:
139+
) -> FsspecStore:
140140
"""
141-
Create a RemoteStore from a URL.
141+
Create a FsspecStore from a URL.
142142
143143
Parameters
144144
----------
@@ -154,7 +154,7 @@ def from_url(
154154
155155
Returns
156156
-------
157-
RemoteStore
157+
FsspecStore
158158
"""
159159
try:
160160
from fsspec import url_to_fs
@@ -185,7 +185,7 @@ async def clear(self) -> None:
185185
pass
186186

187187
def __repr__(self) -> str:
188-
return f"<RemoteStore({type(self.fs).__name__}, {self.path})>"
188+
return f"<FsspecStore({type(self.fs).__name__}, {self.path})>"
189189

190190
def __eq__(self, other: object) -> bool:
191191
return (

tests/conftest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from zarr.abc.store import Store
1414
from zarr.core.sync import sync
1515
from zarr.storage import LocalStore, MemoryStore, StorePath, ZipStore
16-
from zarr.storage.remote import RemoteStore
16+
from zarr.storage.fsspec import FsspecStore
1717

1818
if TYPE_CHECKING:
1919
from collections.abc import Generator
@@ -25,14 +25,14 @@
2525

2626

2727
async def parse_store(
28-
store: Literal["local", "memory", "remote", "zip"], path: str
29-
) -> LocalStore | MemoryStore | RemoteStore | ZipStore:
28+
store: Literal["local", "memory", "fsspec", "zip"], path: str
29+
) -> LocalStore | MemoryStore | FsspecStore | ZipStore:
3030
if store == "local":
3131
return await LocalStore.open(path)
3232
if store == "memory":
3333
return await MemoryStore.open()
34-
if store == "remote":
35-
return await RemoteStore.open(url=path)
34+
if store == "fsspec":
35+
return await FsspecStore.open(url=path)
3636
if store == "zip":
3737
return await ZipStore.open(path + "/zarr.zip", mode="w")
3838
raise AssertionError
@@ -56,8 +56,8 @@ async def local_store(tmpdir: LEGACY_PATH) -> LocalStore:
5656

5757

5858
@pytest.fixture
59-
async def remote_store(url: str) -> RemoteStore:
60-
return await RemoteStore.open(url)
59+
async def remote_store(url: str) -> FsspecStore:
60+
return await FsspecStore.open(url)
6161

6262

6363
@pytest.fixture
@@ -87,7 +87,7 @@ def sync_store(request: pytest.FixtureRequest, tmp_path: LEGACY_PATH) -> Store:
8787
@dataclass
8888
class AsyncGroupRequest:
8989
zarr_format: ZarrFormat
90-
store: Literal["local", "remote", "memory", "zip"]
90+
store: Literal["local", "fsspec", "memory", "zip"]
9191
attributes: dict[str, Any] = field(default_factory=dict)
9292

9393

tests/test_store/test_core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from zarr.core.common import AccessModeLiteral
88
from zarr.storage._utils import normalize_path
99
from zarr.storage.common import StoreLike, StorePath, make_store_path
10+
from zarr.storage.fsspec import FsspecStore
1011
from zarr.storage.local import LocalStore
1112
from zarr.storage.memory import MemoryStore
12-
from zarr.storage.remote import RemoteStore
1313

1414

1515
@pytest.mark.parametrize("path", [None, "", "bar"])
@@ -73,7 +73,7 @@ async def test_make_store_path_invalid() -> None:
7373
async def test_make_store_path_fsspec(monkeypatch) -> None:
7474
pytest.importorskip("fsspec")
7575
store_path = await make_store_path("http://foo.com/bar")
76-
assert isinstance(store_path.store, RemoteStore)
76+
assert isinstance(store_path.store, FsspecStore)
7777

7878

7979
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)