BinaryComponentLink#
- class glue.core.component_link.BinaryComponentLink(left, right, op)#
Bases:
ComponentLinkA ComponentLink that combines two inputs with a binary function
- Parameters:
- left
ComponentID,ComponentLink, or number The first input argument.
- right
ComponentID,ComponentLink, or number The second input argument.
- opfunc
A function with two inputs that works on numpy arrays.
- The ComponentLink represents the logic of applying `op` to the
- data associated with the inputs `left` and `right`.
- left
Methods Summary
compute(data[, view])For a given data set, compute the component comp_to given the data associated with each comp_from and the
usingfunctionreplace_ids(old, new)Replace all references to an old ComponentID with references to new.
Methods Documentation
- compute(data, view=None)#
For a given data set, compute the component comp_to given the data associated with each comp_from and the
usingfunctionThis raises an
glue.core.exceptions.IncompatibleAttributeif the data set doesn’t have all the ComponentIDs needed for the transformation- Parameters:
- data~glue.core.data.Data
The data set to use.
- viewslice or tuple, optional
Optional view (e.g. slice) through the data to use.
- Returns:
- result
The data associated with comp_to component
- replace_ids(old, new)#
Replace all references to an old ComponentID with references to new.
- Parameters:
- old
ComponentID ComponentID to replace.
- new
ComponentID ComponentID to replace with.
- old