blueprints.thing.cyclical module#
Note
If you found yourself here not being a dev, you should probably skip this section or
look up the correspinging docs page of the Thing you were looking after for which this module only
implements its corresponding mirror types. A link to the docs page is to be found in the Types doc
string.
- class blueprints.thing.cyclical.CyclicalThing[source]#
Bases:
CyclicalThingType,BaseThingIf a Thing has a reference, that potentially points above its parent in the hierarchy of the kinematic tree it becomes a kinematic graph, loosing important properties that are relied on for copying. This class is used to enable migration of attributes that might induce a cycle and to mitigated the introduction of a cycle. The
CyclicalThingshould only be properly attached to one parent, keeping the other references back into the kinematic tree as separate non children attributes (making them improper parents). If a reference of a parent (proper and improper) is performing a copy it should not assign a copy of this instance to its attribute, but instead use the_migrate()method. This is used to ensure that this instance is not copied once for each parent.Additionally, attributes are restricted from being set to another Thing, if it is not part of the same kinematic tree. This is necessary to prevent exuberant duplications of \(c^p\) with \(c\) as the number of copies and \(p\) as the number of parents (proper and improper).
If a modification of the kinematic tree results in a parent reference that points outside the kinematic tree, the reference is reset to None.
The class definition must define two sets
_PARENT_REFERENCES(proper) and_OTHER_REFERENCES(improper) as class attributes containing the attribute names under which the parents are assigned to the Thing.