The link function#
Aliases#
halerium.core.link
halerium.core.graph.link
- link(source, target, name=None)#
Establish link.
Establish a link between the source and the target. Typically this is used to designate the output of one sub-graph as the input of another sub-graph, which will connect the two graphs into a longer chain of operations.
The target will effectively be set to be equal to the source. All variables in a target refer to their counterparts in the source, when evaluated.
The source and the target have to meet certain requirements for the link to be accepted: 1. All children of the target must have a counterpart with
the same relative name in the source. For variables, the shape and type (static or dynamic) must also be equal.
The target and its children must not be the target of an existing link.
If the target is not in a graph input, the link must be called from the target’s parent graph.
If the target is in a graph input, the link must be called from the parent graph of the targets parent graph instead.
If the source is not in a graph output, the link must be called from the source’s parent graph.
If the source is ina graph output, the link must be called from the parent graph of the source’s parent graph instead.
- Parameters:
source (LinkableScopetor) – The source.
target (LinkableScopetor) – The target.
name (str, optional) – The name of the Link instance. If None it is chosen automatically. The default is None.