finesse.tree.TreeNode

Overview

class finesse.tree.TreeNode(unicode name, TreeNode parent=None, bool empty=True)

Bases: object

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
namestr

The node name.

parent: :class:`.TreeNode`, optional

The parent tree node, if not the root.

emptybool, 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__(*args, **kwargs)

TreeNode.add(self, child)

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

Draws the solution tree in text form.

TreeNode.from_network(cls, network, root)

Create a tree node hierarchy from an acyclic network.

TreeNode.get(self, ipath)

TreeNode.get_all_children(self)

TreeNode.get_all_parents(self)

TreeNode.get_path(self)

TreeNode.ls(self[, ipath])