phylox.generators.trees.well_known
Functions
|
Generates a balanced tree with the given number of leaves. |
|
Generates a caterpillar tree with the given number of leaves. |
- 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
- phylox.generators.trees.well_known.generate_caterpillar(number_of_leaves)
Generates a caterpillar tree with the given number of leaves.
- Parameters:
number_of_leaves – the number of leaves of the caterpillar tree.
- Returns:
a caterpillar tree with the given number of leaves.
- Example:
>>> from phylox.generators.trees.well_known import generate_caterpillar >>> tree = generate_caterpillar(5) >>> len(tree.leaves) 5