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)
| 193 | |
| 194 | |
| 195 | def 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 | |
| 221 | def _chunk_ds( |
searching dependent graphs…