rayoptics.elem.parttree module¶
Manage connectivity between sequence and element models using a tree.
-
class
PartTree
(opt_model, **kwargs)[source]¶ Bases:
object
-
parent_node
(obj, tag='#element#airgap#dummyifc')[source]¶ Return the parent node for obj, filtered by tag.
-
parent_object
(obj, tag='#element#airgap#dummyifc')[source]¶ Return the parent object (and node) for obj, filtered by tag.
-
get_child_filter
(tag='#element#assembly', not_tag='')[source]¶ Returns a fct that filters a list of nodes to satisfy the tags
-
list_tree
(*args, **kwargs)[source]¶ Print a graphical console representation of the tree.
The optional arguments are passed through to the by_attr filter. Useful examples or arguments include:
- pt.list_tree(lambda node: f”{node.name}: {node.tag}”)
- pt.list_tree(attrname=’tag’)
-
-
sync_part_tree_on_update
(ele_model, seq_model, root_node)[source]¶ Update node names to track element labels.
-
elements_from_sequence
(ele_model, seq_model, part_tree)[source]¶ generate an element list from a sequential model