finesse.tree.TreeNode

Overview

class finesse.tree.TreeNode(name, parent=None, empty=True)[source]

Container for tree-like structures.

Tree nodes can contain other tree nodes, allowing these objects to be built into a tree-like hierarchy useful for representing connections between components, nested data sets, etc.

Parameters

name : str

The node name.

parent: :class:`.TreeNode`, optional

The parent tree node, if not the root.

empty : bool, optional

Whether this node is considered “empty”, which determines which character to use to represent the node in the tree; defaults to True.

Properties

TreeNode.name

Methods

TreeNode.__init__(self, name[, parent, empty])

Initialize self.

TreeNode.from_network(network, root)

Create a tree node hierarchy from an acyclic network.

TreeNode.add(self, child)

TreeNode.get_all_children(self)

TreeNode.get_all_parents(self)

TreeNode.get_path(self)

TreeNode.get(self, ipath)

TreeNode.ls(self[, ipath])

TreeNode.draw_tree(self[, fn_name, title, …])

Draws the solution tree in text form.