stratum_ordered_stores

Strata storage implementations for use with HereditaryStratigraphicColumn.

Forwarded Modules

Modules defined elsewhere made available in this namespace for convenience. To view documentation for these modules, use the search bar or navigate to the source package manually.

provided_stratum_ordered_stores

Built-in mutable sequence.

Classes

HereditaryStratumOrderedStoreDict

Interchangeable backing container for HereditaryStratigraphicColumn.

HereditaryStratumOrderedStoreList

Interchangeable backing container for HereditaryStratigraphicColumn.

HereditaryStratumOrderedStoreTree

Interchangeable backing container for HereditaryStratigraphicColumn.

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.

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.

class HereditaryStratumOrderedStoreList

Interchangeable backing container for HereditaryStratigraphicColumn.

Stores deposited strata using a list implementation. Retained strata are stored from most ancient (index 0, front) to most recent (back). Cloned stores instantiate an independent list (although strata are not deepcopied themselves).

Potentially useful in scenarios where moderate strata counts are retained, many strata are deposited without column cloning, deleted strata tend to be more recent (i.e., not more ancient and toward the front of the list), or many comparisons to estimate most recent common ancestor are made between stratigraphic columns.

Clone() HereditaryStratumOrderedStoreList[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? 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.

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.

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.