Skip to content

Commit 4ec8370

Browse files
committed
rename store_kwargs->chunkmanager_store_kwargs
1 parent f4224f6 commit 4ec8370

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

xarray/backends/api.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ def to_zarr(
15461546
safe_chunks: bool = True,
15471547
storage_options: dict[str, str] | None = None,
15481548
zarr_version: int | None = None,
1549-
store_kwargs: dict[str, Any] | None = None,
1549+
chunkmanager_store_kwargs: dict[str, Any] | None = None,
15501550
) -> backends.ZarrStore:
15511551
...
15521552

@@ -1569,7 +1569,7 @@ def to_zarr(
15691569
safe_chunks: bool = True,
15701570
storage_options: dict[str, str] | None = None,
15711571
zarr_version: int | None = None,
1572-
store_kwargs: dict[str, Any] | None = None,
1572+
chunkmanager_store_kwargs: dict[str, Any] | None = None,
15731573
) -> Delayed:
15741574
...
15751575

@@ -1589,7 +1589,7 @@ def to_zarr(
15891589
safe_chunks: bool = True,
15901590
storage_options: dict[str, str] | None = None,
15911591
zarr_version: int | None = None,
1592-
store_kwargs: dict[str, Any] | None = None,
1592+
chunkmanager_store_kwargs: dict[str, Any] | None = None,
15931593
) -> backends.ZarrStore | Delayed:
15941594
"""This function creates an appropriate datastore for writing a dataset to
15951595
a zarr ztore
@@ -1711,7 +1711,9 @@ def to_zarr(
17111711
writer = ArrayWriter()
17121712
# TODO: figure out how to properly handle unlimited_dims
17131713
dump_to_store(dataset, zstore, writer, encoding=encoding)
1714-
writes = writer.sync(compute=compute, store_kwargs=store_kwargs)
1714+
writes = writer.sync(
1715+
compute=compute, chunkmanager_store_kwargs=chunkmanager_store_kwargs
1716+
)
17151717

17161718
if compute:
17171719
_finalize_store(writes, zstore)

xarray/backends/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ def add(self, source, target, region=None):
164164
else:
165165
target[...] = source
166166

167-
def sync(self, compute=True, store_kwargs=None):
167+
def sync(self, compute=True, chunkmanager_store_kwargs=None):
168168
if self.sources:
169169
chunkmanager = get_chunked_array_type(*self.sources)
170170

171171
# TODO: consider wrapping targets with dask.delayed, if this makes
172172
# for any discernible difference in perforance, e.g.,
173173
# targets = [dask.delayed(t) for t in self.targets]
174174

175-
if store_kwargs is None:
176-
store_kwargs = {}
175+
if chunkmanager_store_kwargs is None:
176+
chunkmanager_store_kwargs = {}
177177

178178
delayed_store = chunkmanager.store(
179179
self.sources,
@@ -182,7 +182,7 @@ def sync(self, compute=True, store_kwargs=None):
182182
compute=compute,
183183
flush=True,
184184
regions=self.regions,
185-
**store_kwargs,
185+
**chunkmanager_store_kwargs,
186186
)
187187
self.sources = []
188188
self.targets = []

xarray/core/daskmanager.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ def store(
198198
):
199199
from dask.array import store
200200

201-
# TODO separate expected store kwargs from other compute kwargs?
202-
203201
return store(
204202
sources=sources,
205203
targets=targets,

xarray/core/dataset.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,7 @@ def to_zarr(
19721972
safe_chunks: bool = True,
19731973
storage_options: dict[str, str] | None = None,
19741974
zarr_version: int | None = None,
1975-
store_kwargs: dict[str, Any] | None = None,
1975+
chunkmanager_store_kwargs: dict[str, Any] | None = None,
19761976
) -> ZarrStore:
19771977
...
19781978

@@ -1994,7 +1994,7 @@ def to_zarr(
19941994
safe_chunks: bool = True,
19951995
storage_options: dict[str, str] | None = None,
19961996
zarr_version: int | None = None,
1997-
store_kwargs: dict[str, Any] | None = None,
1997+
chunkmanager_store_kwargs: dict[str, Any] | None = None,
19981998
) -> Delayed:
19991999
...
20002000

@@ -2013,7 +2013,7 @@ def to_zarr(
20132013
safe_chunks: bool = True,
20142014
storage_options: dict[str, str] | None = None,
20152015
zarr_version: int | None = None,
2016-
store_kwargs: dict[str, Any] | None = None,
2016+
chunkmanager_store_kwargs: dict[str, Any] | None = None,
20172017
) -> ZarrStore | Delayed:
20182018
"""Write dataset contents to a zarr group.
20192019
@@ -2102,7 +2102,7 @@ def to_zarr(
21022102
The desired zarr spec version to target (currently 2 or 3). The
21032103
default of None will attempt to determine the zarr version from
21042104
``store`` when possible, otherwise defaulting to 2.
2105-
store_kwargs : dict
2105+
chunkmanager_store_kwargs : dict
21062106
Additional keyword arguments passed on to the `ChunkManager.store` method used to store
21072107
chunked arrays. For example for a dask array additional kwargs will be passed eventually to
21082108
:py:func:`dask.array.store()`. Experimental API that should not be relied upon.
@@ -2151,7 +2151,7 @@ def to_zarr(
21512151
region=region,
21522152
safe_chunks=safe_chunks,
21532153
zarr_version=zarr_version,
2154-
store_kwargs=store_kwargs,
2154+
chunkmanager_store_kwargs=chunkmanager_store_kwargs,
21552155
)
21562156

21572157
def __repr__(self) -> str:

0 commit comments

Comments
 (0)