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

Function load_datatree

xarray/backends/api.py:195–218  ·  view source on GitHub ↗

Open, load into memory, and close a DataTree from a file or file-like object. This is a thin wrapper around :py:meth:`~xarray.open_datatree`. It differs from `open_datatree` in that it loads the DataTree into memory, closes the file, and returns the DataTree. In contrast, `open_data

(filename_or_obj: T_PathFileOrDataStore, **kwargs)

Source from the content-addressed store, hash-verified

193
194
195def load_datatree(filename_or_obj: T_PathFileOrDataStore, **kwargs) -> DataTree:
196 """Open, load into memory, and close a DataTree from a file or file-like
197 object.
198
199 This is a thin wrapper around :py:meth:`~xarray.open_datatree`. It differs
200 from `open_datatree` in that it loads the DataTree into memory, closes the
201 file, and returns the DataTree. In contrast, `open_datatree` keeps the file
202 handle open and lazy loads its contents. All parameters are passed directly
203 to `open_datatree`. See that documentation for further details.
204
205 Returns
206 -------
207 datatree : DataTree
208 The newly created DataTree.
209
210 See Also
211 --------
212 open_datatree
213 """
214 if "cache" in kwargs:
215 raise TypeError("cache has no effect in this context")
216
217 with open_datatree(filename_or_obj, **kwargs) as dt:
218 return dt.load()
219
220
221def _chunk_ds(

Calls 2

open_datatreeFunction · 0.70
loadMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…