Tree diversity (stub)#

Tree-related diversity measure stubs.

class phypanda.measure.tree.TreeDiversity#

Bases: object

Tree-only diversity measure stub.

Examples

>>> import phypanda as pp
>>> # pp.tree.compute_diversity(network, {"a"})
compute_diversity(network: DirectedPhyNetwork, taxa: Set[str], **kwargs: Any) float#

Compute diversity on trees only.

Parameters:
  • network (DirectedPhyNetwork) – Input phylogenetic network.

  • taxa (Set[str]) – Selected taxa.

  • **kwargs (Any) – Unused measure-specific options.

Returns:

Tree-only diversity value.

Return type:

float

solve_maximization(network: DirectedPhyNetwork, budget: int, costs: Mapping[str, int] | None = None, **kwargs: Any) tuple[float, Set[str]]#

Solve tree-only diversity maximization.

Parameters:
  • network (DirectedPhyNetwork) – Input phylogenetic network.

  • budget (int) – Integer budget.

  • costs (Mapping[str, int] | None, optional) – Optional taxon costs.

  • **kwargs (Any) – Unused optimization options.

Returns:

Objective value and selected taxa.

Return type:

tuple[float, Set[str]]