setitem_array(out_name, array, indices, value)
This function, that is intended to be called by Array.__setitem__
, creates a new dask that assigns values to each block that is touched by the indices, leaving other blocks unchanged.
Each block that overlaps the indices is assigned from the approriate part of the assignment value. The dasks of these value parts are included in the output dask dictionary, as are the dasks of any 1-d dask array indices. This ensures that the dask array assignment value and any dask array indices are not computed until the Array.__setitem__
operation is computed.
The part of the assignment value applies to block is created as a "getitem" slice of the full asignment value.
The dask variable output name.
The dask array that is being assigned to.
Indices to array defining the elements to be assigned.
The assignment value, i.e. the values which will be assigned to elements of array.
A dictionary where the keys are new unique tokens for each block of the form
(out_name, dim_index[, dim_index[, ...]])
and the values are either
(key,)
or
(setitem, key, v_key, block_indices)
where key is an existing top-level dask key of array.
The first case occurs when the block represented by key does not overlap the indices.
The second case occurs when the block represented by key does overlap the indices. setitem is the chunk assignment function; v_key is the dask key of the the part of the assignment value that corresponds to the block; and block_indices are the assigment indices that apply to the block.
The dictionary also includes any additional key/value pairs needed to define v_key, as well as any any additional key/value pairs needed to define dask keys contained in the block_indices list as references to dask array indices.
Master function for array assignment.
The following pages refer to to this document either explicitly or contain code examples using this.
dask.array.slicing.setitem
dask.array.slicing.parse_assignment_indices
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