Model.join_by_all()

Model.join_by_all()#

Model.join_by_all(model, copy=False)[source]#

Joins a second model into this one by all overlapping variable names.

See also

Model.join

Join by no or a manually supplied sequence of overlapping names.

Return type:

Self

Examples

>>> import liesel.model as lsl
>>> x1 = lsl.Var.new_obs(1.0, name="x")
>>> x2 = lsl.Var.new_obs(1.0, name="x")
>>> y = lsl.Var.new_calc(lambda x: x, x2, name="y")
>>> m1 = lsl.Model(x1)
>>> m2 = lsl.Model(x2, y)
>>> m1.join_by_all(m2)
Model(7 nodes, 2 vars)
>>> list(m1.vars)
['x', 'y']
>>> list(m2.vars)
[]
>>> y.value_node[0] is x1
True
>>> m1.seed_nodes_and_vars
[Var(name="x"), Var(name="y")]