dantro.data_loaders.load_xarray module¶
Defines a loader mixin to load xarray objects
-
class
dantro.data_loaders.load_xarray.XarrayLoaderMixin[source]¶ Bases:
objectSupplies functionality to load xarray objects
-
_load_xr_dataarray(*args, **kwargs)¶ Loads an xr.DataArray from a netcdf file into an XrDataContainer.
- Parameters
filepath (str) – Where the xarray-dumped netcdf file is located
TargetCls (type) – The class constructor
load_completely (bool, optional) – If true, will call .load() on the loaded DataArray to load it completely into memory
**load_kwargs – Passed on to xr.load_dataarray, see there for kwargs
- Returns
The reconstructed XrDataContainer
- Return type
-
_load_xr_dataset(*args, **kwargs)¶ Loads an xr.Dataset from a netcdf file into a PassthroughContainer.
Note
As there is no proper equivalent of a dataset in dantro (yet), and unpacking the dataset into a dantro group would reduce functionality, the PassthroughContainer is used here. It should behave almost the same as an xr.Dataset.
- Parameters
filepath (str) – Where the xarray-dumped netcdf file is located
TargetCls (type) – The class constructor
load_completely (bool, optional) – If true, will call .load() on the loaded xr.Dataset to load it completely into memory.
**load_kwargs – Passed on to xr.load_dataarray, see there for kwargs
- Returns
- The reconstructed XrDataset, stored in a
passthrough container.
- Return type
-