MCPcopy
hub / github.com/pydata/xarray / open_zarr

Function open_zarr

xarray/backends/zarr.py:1462–1678  ·  view source on GitHub ↗

Load and decode a dataset from a Zarr store. The `store` object should be a valid store for a Zarr group. `store` variables must contain dimension metadata encoded in the `_ARRAY_DIMENSIONS` attribute or must have NCZarr format. Parameters ---------- store : MutableMapping

(
    store,
    group=None,
    synchronizer=None,
    chunks=_default,
    decode_cf=True,
    mask_and_scale=True,
    decode_times=True,
    concat_characters=True,
    decode_coords: Literal["coordinates", "all"] | bool = True,
    drop_variables=None,
    consolidated=None,
    overwrite_encoded_chunks=False,
    chunk_store=None,
    storage_options=None,
    decode_timedelta=None,
    use_cftime=None,
    zarr_version=None,
    zarr_format=None,
    use_zarr_fill_value_as_mask=None,
    chunked_array_type: str | None = None,
    from_array_kwargs: dict[str, Any] | None = None,
    create_default_indexes=True,
    **kwargs,
)

Source from the content-addressed store, hash-verified

1460
1461
1462def open_zarr(
1463 store,
1464 group=None,
1465 synchronizer=None,
1466 chunks=_default,
1467 decode_cf=True,
1468 mask_and_scale=True,
1469 decode_times=True,
1470 concat_characters=True,
1471 decode_coords: Literal["coordinates", "all"] | bool = True,
1472 drop_variables=None,
1473 consolidated=None,
1474 overwrite_encoded_chunks=False,
1475 chunk_store=None,
1476 storage_options=None,
1477 decode_timedelta=None,
1478 use_cftime=None,
1479 zarr_version=None,
1480 zarr_format=None,
1481 use_zarr_fill_value_as_mask=None,
1482 chunked_array_type: str | None = None,
1483 from_array_kwargs: dict[str, Any] | None = None,
1484 create_default_indexes=True,
1485 **kwargs,
1486):
1487 """Load and decode a dataset from a Zarr store.
1488
1489 The `store` object should be a valid store for a Zarr group. `store`
1490 variables must contain dimension metadata encoded in the
1491 `_ARRAY_DIMENSIONS` attribute or must have NCZarr format.
1492
1493 Parameters
1494 ----------
1495 store : MutableMapping or str
1496 A MutableMapping where a Zarr Group has been stored or a path to a
1497 directory in file system where a Zarr DirectoryStore has been stored.
1498 synchronizer : object, optional
1499 Array synchronizer provided to zarr
1500 group : str, optional
1501 Group path. (a.k.a. `path` in zarr terminology.)
1502 chunks : int, dict, "auto" or None, optional
1503 Used to load the data into dask arrays. Default behavior is to use
1504 ``chunks={}`` if dask is available, otherwise ``chunks=None``.
1505
1506 - ``chunks='auto'`` will use dask ``auto`` chunking taking into account the
1507 engine preferred chunks.
1508 - ``chunks=None`` skips using dask. This uses xarray's internally private
1509 :ref:`lazy indexing classes <internal design.lazy indexing>`,
1510 but data is eagerly loaded into memory as numpy arrays when accessed.
1511 This can be more efficient for smaller arrays, though results may vary.
1512 - ``chunks=-1`` loads the data with dask using a single chunk for all arrays.
1513 - ``chunks={}`` loads the data with dask using engine preferred chunks if
1514 exposed by the backend, otherwise with a single chunk for all arrays.
1515
1516 See dask chunking for more details.
1517 overwrite_encoded_chunks : bool, optional
1518 Whether to drop the zarr chunks encoded for each variable when a
1519 dataset is loaded with specified chunk sizes (default: False)

Callers

nothing calls this directly

Calls 4

guess_chunkmanagerFunction · 0.90
open_datasetFunction · 0.90
keysMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…