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

Method load

xarray/core/dataarray.py:1143–1177  ·  view source on GitHub ↗

Trigger loading data into memory and return this dataarray. Data will be computed and/or loaded from disk or a remote source. Unlike ``.compute``, the original dataarray is modified and returned. Normally, it should not be necessary to call this method in user code,

(self, **kwargs)

Source from the content-addressed store, hash-verified

1141 return cls(variable, coords, name=name, indexes=indexes, fastpath=True)
1142
1143 def load(self, **kwargs) -> Self:
1144 """Trigger loading data into memory and return this dataarray.
1145
1146 Data will be computed and/or loaded from disk or a remote source.
1147
1148 Unlike ``.compute``, the original dataarray is modified and returned.
1149
1150 Normally, it should not be necessary to call this method in user code,
1151 because all xarray functions should either work on deferred data or
1152 load data automatically. However, this method can be necessary when
1153 working with many file objects on disk.
1154
1155 Parameters
1156 ----------
1157 **kwargs : dict
1158 Additional keyword arguments passed on to ``dask.compute``.
1159
1160 Returns
1161 -------
1162 object : DataArray
1163 Same object but with lazy data and coordinates as in-memory arrays.
1164
1165 See Also
1166 --------
1167 dask.compute
1168 DataArray.load_async
1169 DataArray.compute
1170 Dataset.load
1171 Variable.load
1172 """
1173 ds = self._to_temp_dataset().load(**kwargs)
1174 new = self._from_temp_dataset(ds)
1175 self._variable = new._variable
1176 self._coords = new._coords
1177 return self
1178
1179 async def load_async(self, **kwargs) -> Self:
1180 """Trigger and await asynchronous loading of data into memory and return this dataarray.

Callers 1

computeMethod · 0.45

Calls 2

_to_temp_datasetMethod · 0.95
_from_temp_datasetMethod · 0.95

Tested by

no test coverage detected