Skip to main content
`Ctrl`+`K`

# skbio.tree.TreeNode.create_caches

TreeNode.create_caches()

  Construct an internal lookup table to facilitate searching by name.

  Raises:
    DuplicateNodeError

      If there are duplicate tip names.

  See also

  `has_caches`
  `clear_caches`
  `find`

  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.