MCPcopy Index your code
hub / github.com/pydata/xarray / ZarrBackendEntrypoint

Class ZarrBackendEntrypoint

xarray/backends/zarr.py:1681–1864  ·  view source on GitHub ↗

Backend for ".zarr" files based on the zarr package. For more information about the underlying library, visit: https://zarr.readthedocs.io/en/stable See Also -------- backends.ZarrStore

Source from the content-addressed store, hash-verified

1679
1680
1681class ZarrBackendEntrypoint(BackendEntrypoint):
1682 """
1683 Backend for ".zarr" files based on the zarr package.
1684
1685 For more information about the underlying library, visit:
1686 https://zarr.readthedocs.io/en/stable
1687
1688 See Also
1689 --------
1690 backends.ZarrStore
1691 """
1692
1693 description = "Open zarr files (.zarr) using zarr in Xarray"
1694 url = "https://docs.xarray.dev/en/stable/generated/xarray.backends.ZarrBackendEntrypoint.html"
1695 supports_groups = True
1696
1697 def guess_can_open(self, filename_or_obj: T_PathFileOrDataStore) -> bool:
1698 if isinstance(filename_or_obj, str | os.PathLike):
1699 # allow a trailing slash to account for an autocomplete
1700 # adding it.
1701 _, ext = os.path.splitext(str(filename_or_obj).rstrip("/"))
1702 return ext == ".zarr"
1703
1704 return False
1705
1706 def open_dataset(
1707 self,
1708 filename_or_obj: T_PathFileOrDataStore,
1709 *,
1710 mask_and_scale=True,
1711 decode_times=True,
1712 concat_characters=True,
1713 decode_coords=True,
1714 drop_variables: str | Iterable[str] | None = None,
1715 use_cftime=None,
1716 decode_timedelta=None,
1717 group=None,
1718 mode="r",
1719 synchronizer=None,
1720 consolidated=None,
1721 chunk_store=None,
1722 storage_options=None,
1723 zarr_version=None,
1724 zarr_format=None,
1725 store=None,
1726 engine=None,
1727 use_zarr_fill_value_as_mask=None,
1728 cache_members: bool = True,
1729 ) -> Dataset:
1730 filename_or_obj = _normalize_path(filename_or_obj)
1731 if not store:
1732 store = ZarrStore.open_group(
1733 filename_or_obj,
1734 group=group,
1735 mode=mode,
1736 synchronizer=synchronizer,
1737 consolidated=consolidated,
1738 consolidate_on_close=False,

Callers 1

test_zarr_entrypointFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_zarr_entrypointFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…