Reconstruct correct topology after nodes have been removed.

Internal nodes with only one child will be removed and new connections will be made to reflect change. This method is useful to call following node removals as it will clean up nodes with singular children.

Names and properties of singular children will override the names and properties of their parents following the prune.

Node lookup caches are invalidated.


>>> from skbio import TreeNode
>>> tree =["((a,b)c,(d,e)f)root;"])
>>> to_delete = tree.find('b')
>>> tree.remove_deleted(lambda x: x == to_delete)
>>> print(tree)

>>> tree.prune()
>>> print(tree)