MCPcopy Create free account
hub / github.com/dask/dask / persist

Method persist

dask/typing.py:302–347  ·  view source on GitHub ↗

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

(self: CollType, **kwargs: Any)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected