fuse_linear(dsk, keys=None, dependencies=None, rename_keys=True)
If specified, the keys in keys
keyword argument are not fused. Supply dependencies
from output of cull
if available to avoid recomputing dependencies.
This function is mostly superseded by ``fuse``
{key: [list-of-keys]}. Must be a list to provide count of each key This optional input often comes from cull
Whether to rename fused keys with default_fused_linear_keys_renamer
or not. Renaming fused keys can keep the graph more understandable and comprehensive, but it comes at the cost of additional processing. If False, then the top-most key will be used. For advanced usage, a func is also accepted, new_key = rename_keys(fused_key_list)
.
to accelerate other downstream optimizations.
Return new dask graph with linear sequence of tasks fused together.
>>> d = {'a': 1, 'b': (inc, 'a'), 'c': (inc, 'b')}This example is valid syntax, but we were not able to check execution
... dsk, dependencies = fuse(d)
... dsk # doctest: +SKIP {'a-b-c': (inc, (inc, 1)), 'c': 'a-b-c'}
>>> dsk, dependencies = fuse(d, rename_keys=False)This example is valid syntax, but we were not able to check execution
... dsk # doctest: +ELLIPSIS {'c': (<function inc at ...>, (<function inc at ...>, 1))}
>>> dsk, dependencies = fuse(d, keys=['b'], rename_keys=False)See :
... dsk # doctest: +ELLIPSIS {'b': (<function inc at ...>, 1), 'c': (<function inc at ...>, 'b')}
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them