|
4 | 4 | import json |
5 | 5 | import os |
6 | 6 | import struct |
7 | | -from collections.abc import Hashable, Iterable, Mapping |
| 7 | +from collections.abc import Hashable, Iterable, Mapping, MutableMapping |
8 | 8 | from typing import TYPE_CHECKING, Any, Literal, Self, cast |
9 | 9 |
|
10 | 10 | import numpy as np |
|
28 | 28 | from xarray.core.treenode import NodePath |
29 | 29 | from xarray.core.types import ZarrWriteModes |
30 | 30 | from xarray.core.utils import ( |
| 31 | + Default, |
31 | 32 | FrozenDict, |
32 | 33 | HiddenKeyDict, |
33 | 34 | _default, |
|
43 | 44 | if TYPE_CHECKING: |
44 | 45 | from xarray.core.dataset import Dataset |
45 | 46 | from xarray.core.datatree import DataTree |
46 | | - from xarray.core.types import ZarrArray, ZarrGroup |
| 47 | + from xarray.core.types import T_Chunks, ZarrArray, ZarrGroup |
47 | 48 |
|
48 | 49 |
|
49 | 50 | def _get_mappers(*, storage_options, store, chunk_store): |
@@ -1411,30 +1412,30 @@ def _validate_encoding(self, encoding) -> None: |
1411 | 1412 |
|
1412 | 1413 |
|
1413 | 1414 | def open_zarr( |
1414 | | - store, |
1415 | | - group=None, |
1416 | | - synchronizer=None, |
1417 | | - chunks=_default, |
1418 | | - decode_cf=True, |
1419 | | - mask_and_scale=True, |
1420 | | - decode_times=True, |
1421 | | - concat_characters=True, |
| 1415 | + store: str | os.PathLike[Any] | MutableMapping | None, |
| 1416 | + group: str | None = None, |
| 1417 | + synchronizer: object | None = None, |
| 1418 | + chunks: T_Chunks | Default = _default, |
| 1419 | + decode_cf: bool = True, |
| 1420 | + mask_and_scale: bool = True, |
| 1421 | + decode_times: bool = True, |
| 1422 | + concat_characters: bool = True, |
1422 | 1423 | decode_coords: Literal["coordinates", "all"] | bool = True, |
1423 | | - drop_variables=None, |
1424 | | - consolidated=None, |
1425 | | - overwrite_encoded_chunks=False, |
1426 | | - chunk_store=None, |
1427 | | - storage_options=None, |
1428 | | - decode_timedelta=None, |
1429 | | - use_cftime=None, |
1430 | | - zarr_version=None, |
1431 | | - zarr_format=None, |
1432 | | - use_zarr_fill_value_as_mask=None, |
| 1424 | + drop_variables: str | Iterable[str] | None = None, |
| 1425 | + consolidated: bool | None = None, |
| 1426 | + overwrite_encoded_chunks: bool = False, |
| 1427 | + chunk_store: MutableMapping | None = None, |
| 1428 | + storage_options: dict[str, Any] | None = None, |
| 1429 | + decode_timedelta: bool | None = None, |
| 1430 | + use_cftime: bool | None = None, |
| 1431 | + zarr_version: int | None = None, |
| 1432 | + zarr_format: int | None = None, |
| 1433 | + use_zarr_fill_value_as_mask: bool | None = None, |
1433 | 1434 | chunked_array_type: str | None = None, |
1434 | 1435 | from_array_kwargs: dict[str, Any] | None = None, |
1435 | | - create_default_indexes=True, |
1436 | | - **kwargs, |
1437 | | -): |
| 1436 | + create_default_indexes: bool = True, |
| 1437 | + **kwargs: Any, |
| 1438 | +) -> Dataset: |
1438 | 1439 | """Load and decode a dataset from a Zarr store. |
1439 | 1440 |
|
1440 | 1441 | The `store` object should be a valid store for a Zarr group. `store` |
|
0 commit comments