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

Function make_dict

xarray/core/parallel.py:142–149  ·  view source on GitHub ↗

Map variable name to numpy(-like) data (Dataset.to_dict() is too complicated).

(x: DataArray | Dataset)

Source from the content-addressed store, hash-verified

140
141
142def make_dict(x: DataArray | Dataset) -> dict[Hashable, Any]:
143 """Map variable name to numpy(-like) data
144 (Dataset.to_dict() is too complicated).
145 """
146 if isinstance(x, DataArray):
147 x = x._to_temp_dataset()
148
149 return {k: v.data for k, v in x.variables.items()}
150
151
152def _get_chunk_slicer(dim: Hashable, chunk_index: Mapping, chunk_bounds: Mapping):

Callers 1

_wrapperFunction · 0.85

Calls 2

_to_temp_datasetMethod · 0.80
itemsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…