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

Method persist

xarray/core/dataarray.py:1249–1272  ·  view source on GitHub ↗

Trigger computation in constituent dask arrays This keeps them as dask arrays but encourages them to keep data in memory. This is particularly useful when on a distributed machine. When on a single machine consider using ``.compute()`` instead. Like compute (but unl

(self, **kwargs)

Source from the content-addressed store, hash-verified

1247 return new.load(**kwargs)
1248
1249 def persist(self, **kwargs) -> Self:
1250 """Trigger computation in constituent dask arrays
1251
1252 This keeps them as dask arrays but encourages them to keep data in
1253 memory. This is particularly useful when on a distributed machine.
1254 When on a single machine consider using ``.compute()`` instead.
1255 Like compute (but unlike load), the original dataset is left unaltered.
1256
1257 Parameters
1258 ----------
1259 **kwargs : dict
1260 Additional keyword arguments passed on to ``dask.persist``.
1261
1262 Returns
1263 -------
1264 object : DataArray
1265 New object with all dask-backed data and coordinates as persisted dask arrays.
1266
1267 See Also
1268 --------
1269 dask.persist
1270 """
1271 ds = self._to_temp_dataset().persist(**kwargs)
1272 return self._from_temp_dataset(ds)
1273
1274 def copy(self, deep: bool = True, data: Any = None) -> Self:
1275 """Returns a copy of this array.

Callers

nothing calls this directly

Calls 2

_to_temp_datasetMethod · 0.95
_from_temp_datasetMethod · 0.95

Tested by

no test coverage detected