dask 2021.10.0

BackRef

This is a dictionary-backed instance of BlockwiseDep . The purpose of this class is to simplify the construction of IO-based Blockwise Layers with block/partition-dependent function arguments that are difficult to calculate at graph-materialization time.

Dictionary-based Blockwise-IO argument

See Also

dask.blockwise.Blockwise
dask.blockwise.BlockwiseDep

Examples

Specify an IO-based function for the Blockwise Layer. Note that the function will be passed a single input object when the task is executed (e.g. a single tuple or dict ):

This example is valid syntax, but we were not able to check execution
>>> import pandas as pd
... func = lambda x: pd.read_csv(**x)

Use BlockwiseDepDict to define the input argument to func for each block/partition:

This example is valid syntax, but we were not able to check execution
>>> dep = BlockwiseDepDict(
...  mapping={
...  (0,) : {
...  "filepath_or_buffer": "data.csv",
...  "skiprows": 1,
...  "nrows": 2,
...  "names": ["a", "b"],
...  },
...  (1,) : {
...  "filepath_or_buffer": "data.csv",
...  "skiprows": 3,
...  "nrows": 2,
...  "names": ["a", "b"],
...  },
...  }
... )

Construct a Blockwise Layer with dep speficied in the indices list:

This example is valid syntax, but we were not able to check execution
>>> layer = Blockwise(
...  output="collection-name",
...  output_indices="i",
...  dsk={"collection-name": (func, '_0')},
...  indices=[(dep, "i")],
...  numblocks={},
... )
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

dask.blockwise.BlockwiseDepDict dask.blockwise.BlockwiseDep

Local connectivity graph

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


File: /dask/blockwise.py#101
type: <class 'type'>
Commit: