openpathsampling.treelogic.TreeMixin

class openpathsampling.treelogic.TreeMixin[source]

A mixin that provides basic tree handling.

A tree is basically a node with children of the same type. The mixin requires to implement .subnodes to contain a list of children.

The __contains__ operator requires _default_match to be implemented. Otherwise is defaults to a comparison between two elements.

__init__()

Methods

__init__()

depth_post_order(fnc[, level])

Traverse the tree in post-order applying a function with depth

depth_pre_order(fnc[, level, only_canonical])

Traverse the tree of node in pre-order applying a function

key(change)

keylist()

Return a list of key : subtree tuples

map_post_order(fnc, **kwargs)

Traverse the tree in post-order applying a function

map_pre_order(fnc, **kwargs)

Traverse the tree in pre-order applying a function

map_tree(fnc)

Apply a function to each node and return a nested tree of results

tree()

Return the object as a tree structure of nested lists of nodes

Attributes

identifier

A unique identifier to build the unique key for a position in a tree