Trigger loading data into memory and return a new dataarray. Data will be computed and/or loaded from disk or a remote source. Unlike ``.load``, the original dataarray is left unaltered. Normally, it should not be necessary to call this method in user code, because
(self, **kwargs)
| 1214 | return self |
| 1215 | |
| 1216 | def compute(self, **kwargs) -> Self: |
| 1217 | """Trigger loading data into memory and return a new dataarray. |
| 1218 | |
| 1219 | Data will be computed and/or loaded from disk or a remote source. |
| 1220 | |
| 1221 | Unlike ``.load``, the original dataarray is left unaltered. |
| 1222 | |
| 1223 | Normally, it should not be necessary to call this method in user code, |
| 1224 | because all xarray functions should either work on deferred data or |
| 1225 | load data automatically. However, this method can be necessary when |
| 1226 | working with many file objects on disk. |
| 1227 | |
| 1228 | Parameters |
| 1229 | ---------- |
| 1230 | **kwargs : dict |
| 1231 | Additional keyword arguments passed on to ``dask.compute``. |
| 1232 | |
| 1233 | Returns |
| 1234 | ------- |
| 1235 | object : DataArray |
| 1236 | New object with the data and all coordinates as in-memory arrays. |
| 1237 | |
| 1238 | See Also |
| 1239 | -------- |
| 1240 | dask.compute |
| 1241 | DataArray.load |
| 1242 | DataArray.load_async |
| 1243 | Dataset.compute |
| 1244 | Variable.compute |
| 1245 | """ |
| 1246 | new = self.copy(deep=False) |
| 1247 | return new.load(**kwargs) |
| 1248 | |
| 1249 | def persist(self, **kwargs) -> Self: |
| 1250 | """Trigger computation in constituent dask arrays |