skbio.tree.TreeNode.create_caches#

TreeNode.create_caches()[source]#

Construct an internal lookup table to facilitate searching by name.

Deprecated since version 0.6.3: This method will become a private member in version 0.7.0. It is meant to be called automatically by find() and find_all(), and it does not make any public-facing effect.

Raises:
DuplicateNodeError

If there are duplicate tip names.

Notes

This method is automatically called during the first search in a tree (methods find() and find_all()). After that, subsequent searches will utilize the constructed lookup table, until it is deleted.

This method may be called from any node within a tree. The lookup table will be attached to the root node of the tree.

This method will not cache nodes whose name is None. This method will raise an error if a name conflict in the tips is discovered, but will not raise if on internal nodes. This is because, in practice, the tips of a tree are required to be unique while no such requirement holds for internal nodes.