AssignDestructionTimeYoungestPlusOneTriePostprocessor

class AssignDestructionTimeYoungestPlusOneTriePostprocessor[source]

Functor to assign a destruction time property to trie nodes.

Destruction time of leaf nodes are set to infinity. Destruction time of inner nodes is calculated as the minimum of its children’s origin times plus one.

__init__(assigned_property: str = 'destruction_time', origin_time_property: str = 'origin_time') None[source]

Initialize functor instance.

Parameters

assigned_propertystr, default “destruction_time”

The property name for the assigned destruction tim.

origin_time_propertystr, default “origin_time”

The property name for the node’s origin time.

Methods

__init__(assigned_property: str = 'destruction_time', origin_time_property: str = 'origin_time') None[source]

Initialize functor instance.

Parameters

assigned_propertystr, default “destruction_time”

The property name for the assigned destruction tim.

origin_time_propertystr, default “origin_time”

The property name for the node’s origin time.

__call__(trie: ~hstrat.phylogenetic_inference.tree._impl._TrieInnerNode.TrieInnerNode, p_differentia_collision: float, mutate: bool = False, progress_wrap: ~typing.Callable = <function AssignDestructionTimeYoungestPlusOneTriePostprocessor.<lambda>>) TrieInnerNode[source]

Assign destruction times to trie nodes based on their childrens’ origin times.

Parameters

trieTrieInnerNode

The input trie to be postprocessed.

p_differentia_collisionfloat

The multiplicative inverse of the number of possible differentia.

Not used in the current implementation.

mutatebool, default False

Are side effects on the input argument trie allowed?

progress_wraptyping.Callable, optional

Pass tqdm or equivalent to report progress.

Returns

TrieInnerNode

The postprocessed trie with assigned destruction times.