phylox.generators.trees.well_known.generate_balanced_tree
- phylox.generators.trees.well_known.generate_balanced_tree(number_of_leaves)
Generates a balanced tree with the given number of leaves.
- Parameters:
number_of_leaves – the number of leaves of the balanced tree (power of 2).
- Returns:
a balanced tree with the given number of leaves.
- Example:
>>> from phylox.generators.trees.well_known import generate_balanced_tree >>> tree = generate_balanced_tree(8) >>> len(tree.leaves) 8