Another PartTree question #78
-
Another question - in the part tree how are nodes compared? I am trying to understand the semantics for code such as:
leading to
leading to
Which eventually leads to |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
I assume they're compared in the same way as keys are compared in python. It seems to work that way, at least. Each node in the part_tree has the additional attributes I've done a lot recently with the part_tree, adding assemblies for collections of parts, and being able to flip a subsection of a sequence. We need to integrate what you've done with typing into the code base soon. |
Beta Was this translation helpful? Give feedback.
-
I also noticed that the elements in ElementModel do not have a class hierarchy; they are used more like duck typing. Is that a deliberate design choice? |
Beta Was this translation helpful? Give feedback.
-
There is still a lot to do but its a bit frustrating that Python doesn't handle cycling dependencies very well. It means as it stands some annotations cannot be added. |
Beta Was this translation helpful? Give feedback.
I assume they're compared in the same way as keys are compared in python. It seems to work that way, at least.
Each node in the part_tree has the additional attributes
name
,id
, andtag
. Theid
may be an object or a tuple, just like a key for a dict. Most times I just have an object instance as a node id. Gaps are a special case in that they are used one way in element-land but the same gap can appear multiple times in double pass systems. This is a case where element model information can help to enforce correctness in multipass sequential models. So the gap in a sequential model is a combination of thegap
and thez_dir
for that segment. In the element model, thegap
is only present onc…