Skip to content

topology

detect_cycle(nodes, visited)

Detect the cycles in the tree.

get_next_node(node, nodes=None)

Get next node in the children from given node, return None if last node

get_previous_node(node)

Get previous node in the children, return None if first node

is_first_node(node)

Check if the node is the first node of the tree.

is_last_node(node, nodes=None)

Check if the node is the last node of the list.

list_index(node, collection=None)

Check if node is in list with "is" operator.

remove_from_tree(node)

Remove a node from the tree. DO NOT take care of children of to-be-delete node

replace_node_in_tree(old_node, new_node)

Replace old_node with new_node in the children of the old nodes' parent.

Used when children (downstream) changes that cannot be covered with the ScheduleNodeTransformer.

swap_node_position_in_tree(top_node, child_node)

Top node becomes child, child becomes top node.