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

Function _get_mappers

xarray/backends/zarr.py:49–76  ·  view source on GitHub ↗
(*, storage_options, store, chunk_store)

Source from the content-addressed store, hash-verified

47
48
49def _get_mappers(*, storage_options, store, chunk_store):
50 # expand str and path-like arguments
51 store = _normalize_path(store)
52 chunk_store = _normalize_path(chunk_store)
53
54 kwargs = {}
55 if storage_options is None:
56 mapper = store
57 chunk_mapper = chunk_store
58 else:
59 if not isinstance(store, str):
60 raise ValueError(
61 f"store must be a string to use storage_options. Got {type(store)}"
62 )
63
64 if _zarr_v3():
65 kwargs["storage_options"] = storage_options
66 mapper = store
67 chunk_mapper = chunk_store
68 else:
69 from fsspec import get_mapper
70
71 mapper = get_mapper(store, **storage_options)
72 if chunk_store is not None:
73 chunk_mapper = get_mapper(chunk_store, **storage_options)
74 else:
75 chunk_mapper = chunk_store
76 return kwargs, mapper, chunk_mapper
77
78
79def _choose_default_mode(

Callers 1

get_writable_zarr_storeFunction · 0.90

Calls 3

_normalize_pathFunction · 0.90
typeFunction · 0.85
_zarr_v3Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…