Bases: object
ComponentLinks represent transformation logic between ComponentIDs
ComponentID
The input ComponentIDs
ComponentID
The target component ID
The translation function which maps data from comp_from
to comp_to
. The using function should satisfy using(data[comp_from[0]],...,data[comp_from[-1]]) = desired data
. If not specifies, this defaults to an identity function.
The inverse translation function, if exists
A short description for the link. This is used e.g. in the link editor.
The names to use for the inputs to the using
function. By default this is determined by inspecting the function signature. This is used e.g. in the link editor.
The name to use for the output of the using
function. This is used e.g. in the link editor.
Notes
Both inverse
and using
should accept and return numpy arrays.
Examples
def hours_to_minutes(hours): return hours * 60 d = Data(hour=[1, 2, 3]) hour = d.id['hour'] minute = ComponentID('minute') link = ComponentLink( [hour], minute, using=hours_to_minutes) link.compute(d) # array([ 60, 120, 180]) d.add_component_link(link) d['minute'] # array([ 60, 120, 180])
Attributes Summary
Methods Summary
Attributes Documentation
Methods Documentation
For a given data set, compute the component comp_to given the data associated with each comp_from and the using
function
This raises an glue.core.exceptions.IncompatibleAttribute
if the data set doesn’t have all the ComponentIDs needed for the transformation
The data set to use.
Optional view (e.g. slice) through the data to use.
The data associated with comp_to component
The list of input ComponentIDs
The inverse transformation, or None
The target ComponentID
The transformation function
Replace all references to an old ComponentID with references to new.
ComponentID
ComponentID to replace.
ComponentID
ComponentID to replace with.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4