Persist this dask collection into memory This turns a lazy Dask collection into a Dask collection with the same metadata, but now with the results fully computed or actively computing in the background. The action of function differs significantly depending on the a
(self, **kwargs)
| 309 | ) |
| 310 | |
| 311 | def persist(self, **kwargs): |
| 312 | """Persist this dask collection into memory |
| 313 | |
| 314 | This turns a lazy Dask collection into a Dask collection with the same |
| 315 | metadata, but now with the results fully computed or actively computing |
| 316 | in the background. |
| 317 | |
| 318 | The action of function differs significantly depending on the active |
| 319 | task scheduler. If the task scheduler supports asynchronous computing, |
| 320 | such as is the case of the dask.distributed scheduler, then persist |
| 321 | will return *immediately* and the return value's task graph will |
| 322 | contain Dask Future objects. However if the task scheduler only |
| 323 | supports blocking computation then the call to persist will *block* |
| 324 | and the return value's task graph will contain concrete Python results. |
| 325 | |
| 326 | This function is particularly useful when using distributed systems, |
| 327 | because the results will be kept in distributed memory, rather than |
| 328 | returned to the local process as with compute. |
| 329 | |
| 330 | Parameters |
| 331 | ---------- |
| 332 | scheduler : string, optional |
| 333 | Which scheduler to use like "threads", "synchronous" or "processes". |
| 334 | If not provided, the default is to check the global settings first, |
| 335 | and then fall back to the collection defaults. |
| 336 | optimize_graph : bool, optional |
| 337 | If True [default], the graph is optimized before computation. |
| 338 | Otherwise the graph is run as is. This can be useful for debugging. |
| 339 | **kwargs |
| 340 | Extra keywords to forward to the scheduler function. |
| 341 | |
| 342 | Returns |
| 343 | ------- |
| 344 | New dask collections backed by in-memory data |
| 345 | |
| 346 | See Also |
| 347 | -------- |
| 348 | dask.persist |
| 349 | """ |
| 350 | (result,) = persist(self, traverse=False, **kwargs) |
| 351 | return result |
| 352 | |
| 353 | def compute(self, **kwargs): |
| 354 | """Compute this dask collection |
no test coverage detected