HereditaryStratumOrderedStoreDict

class HereditaryStratumOrderedStoreDict

Interchangeable backing container for HereditaryStratigraphicColumn.

Stores deposited strata using a dict implementation. Retained strata are stored as dict values with their associated deposition ranks as keys.

Potentially useful in scenarios where large strata counts are retained or deleted strata tend to be more ancient.

__init__()[source]

Initialize instance variables.

Methods

Clone() HereditaryStratumOrderedStoreDict[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: Iterable[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. Not used in this method.

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 column position ot 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 deposition generation to column position.

What is the deposition rank of the stratum positioned at index i among retained strata? Index order is from most ancient (index 0) to most recent.

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 deposition ranks.

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.