MultiLink¶
-
class
glue.core.link_helpers.
MultiLink
(cids1=None, cids2=None, forwards=None, backwards=None, labels1=None, labels2=None, **kwargs)[source]¶ Bases:
glue.core.link_helpers.BaseMultiLink
A link collection that is generated on-the-fly based on forward and backward transformation functions and lists of input/output component IDs.
This is similar to
BaseMultiLink()
except that theforwards
andbackwards
functions are specified in the initializer rather than being methods of the class.- Parameters
- forwardsfunction
Function that maps
cids1
tocids2
. This should have the signaturecids2 = forwards(*cids1)
, and is assumed to return a tuple. If not specified, no forward links are calculated.- backwardsfunction
The inverse function to
forwards
. If not specified, no forward links are calculated.- labels1list of str
The human-readable names of the inputs to the
forwards
function. If not specified, this is set to the argument names offorwards
.- labels2list of str
The human-readable names of the inputs to the
backwards
function. If not specified, this is set to the argument names ofbackwards
.- kwargs :
Additional arguments are passed