HereditaryStratumOrderedStoreTree

class HereditaryStratumOrderedStoreTree

Interchangeable backing container for HereditaryStratigraphicColumn.

Stores deposited strata as a linked tree. Retained strata pertinent to the store are essentially a linear linked list reaching from tree leaf (most recent stratum) back to the tree root (most ancient stratum). Cloned stores directly share common components of the tree and then branch out different leaves as subsequent strata are deposited. Stratum deletion results in the entire strata sequence more recent than the deleted stratum being copied into an independent branch for the store that requested the deletion.

Potentially useful in scenarios where stratum deletions are uncommon (i.e., the perfect resolution stratum retention policy) or column cloning occurs heavily without much stratum deposition.

__init__()[source]

Initialize instance variables.

Methods

Clone() HereditaryStratumOrderedStoreTree[source]

Create an independent copy of the store.

Returned copy contains identical data but may be freely altered without affecting data within this store.

DelRanks(ranks: Iterator[int], get_column_index_of_rank: Callable | None = None) None[source]

Purge strata with specified deposition ranks from the store.

Parameters

ranksiterator over int

The ranks that are to be deleted.

get_column_index_of_rankcallable, optional

Callable that returns the deposition rank of the stratum positioned at index i among retained strata.

DepositStratum(rank: int | None, stratum: HereditaryStratum) None[source]

Insert a new stratum into the store.

Parameters

ranktyping.Optional[int]

The position of the stratum being deposited within the sequence of strata deposited into the column. Precisely, the number of strata that have been deposited before stratum.

stratumHereditaryStratum

The stratum to deposit.

GetColumnIndexOfRank(rank: int) int | None[source]

Map from column position to deposition generation.

What is the index position within retained strata of the stratum deposited at rank r? Returns None if no stratum with rank r is present within the store.

GetNumStrataRetained() int[source]

How many strata are present in the store?

May be fewer than the number of strata deposited if deletions have occured.

GetRankAtColumnIndex(index: int) int[source]

Map from deposition generation to column position.

What is the deposition rank of the stratum positioned at index i among retained strata?

GetStratumAtColumnIndex(index: int, get_rank_at_column_index: Callable | None = None) HereditaryStratum[source]

Get the stratum positioned at index i among retained strata.

Index order is from most ancient (index 0) to most recent.

Parameters

ranksiterator over int

The ranks that are to be deleted.

get_column_index_of_rankcallable, optional

Callable that returns the index position within retained strata of the stratum deposited at rank r.

IterRankDifferentiaZip(get_rank_at_column_index: Callable | None = None, start_column_index: int = 0) Iterator[Tuple[int, int]][source]

Iterate over differentia and corresponding depsotion rank.

Values yielded as tuples. Guaranteed ordered from most ancient to most recent.

Parameters

get_rank_at_column_indexcallable, optional

Callable that returns the deposition rank of the stratum positioned at index i among retained strata.

start_column_indexcallable, optional

Number of strata to skip over before yielding first result from the iterator. Default 0, meaning no strata are skipped over.

IterRetainedRanks() Iterator[int][source]

Iterate over deposition ranks of strata present in the store from most ancient to most recent.

The store may be altered during iteration without iterator invalidation, although subsequent updates will not be reflected in the iterator.

IterRetainedStrata() Iterator[HereditaryStratum][source]

Iterate over stored strata from most ancient to most recent.

__init__()[source]

Initialize instance variables.