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