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

Method visualize

dask/base.py:255–305  ·  view source on GitHub ↗

Render the computation of this object's task graph using graphviz. Requires ``graphviz`` to be installed. Parameters ---------- filename : str or None, optional The name of the file to write to disk. If the provided `filename` doesn't include

(self, filename="mydask", format=None, optimize_graph=False, **kwargs)

Source from the content-addressed store, hash-verified

253 __slots__ = ("__weakref__",)
254
255 def visualize(self, filename="mydask", format=None, optimize_graph=False, **kwargs):
256 """Render the computation of this object's task graph using graphviz.
257
258 Requires ``graphviz`` to be installed.
259
260 Parameters
261 ----------
262 filename : str or None, optional
263 The name of the file to write to disk. If the provided `filename`
264 doesn't include an extension, '.png' will be used by default.
265 If `filename` is None, no file will be written, and we communicate
266 with dot using only pipes.
267 format : {'png', 'pdf', 'dot', 'svg', 'jpeg', 'jpg'}, optional
268 Format in which to write output file. Default is 'png'.
269 optimize_graph : bool, optional
270 If True, the graph is optimized before rendering. Otherwise,
271 the graph is displayed as is. Default is False.
272 color: {None, 'order'}, optional
273 Options to color nodes. Provide ``cmap=`` keyword for additional
274 colormap
275 **kwargs
276 Additional keyword arguments to forward to ``to_graphviz``.
277
278 Examples
279 --------
280 >>> x.visualize(filename='dask.pdf') # doctest: +SKIP
281 >>> x.visualize(filename='dask.pdf', color='order') # doctest: +SKIP
282
283 Returns
284 -------
285 result : IPython.display.Image, IPython.display.SVG, or None
286 See dask.dot.dot_graph for more information.
287
288 See Also
289 --------
290 dask.visualize
291 dask.dot.dot_graph
292
293 Notes
294 -----
295 For more information on optimization see here:
296
297 https://docs.dask.org/en/latest/optimize.html
298 """
299 return visualize(
300 self,
301 filename=filename,
302 format=format,
303 optimize_graph=optimize_graph,
304 **kwargs,
305 )
306
307 def persist(self, **kwargs):
308 """Persist this dask collection into memory

Callers

nothing calls this directly

Calls 1

visualizeFunction · 0.70

Tested by

no test coverage detected