Skip to content

LocalRealization

from tensorsig.offset_coded_signatures.plans import LocalRealization

A local alphabet map together with window, channel, and depth semantics.

signature

signature(*, coordinates: Literal['chronological', 'dense'] | None = None, selection: WordSelection | None = None, depths: tuple[int, ...] | None = None, rank_tolerance: float | None = None) -> SignaturePlan

Compile local signature coordinates.

Source code in src/tensorsig/offset_coded_signatures/plans.py
def signature(
    self,
    *,
    coordinates: Literal["chronological", "dense"] | None = None,
    selection: WordSelection | None = None,
    depths: tuple[int, ...] | None = None,
    rank_tolerance: float | None = None,
) -> SignaturePlan:
    """Compile local signature coordinates."""
    return _compile_signature(
        self,
        coordinates=coordinates,
        selection=selection,
        depths=depths,
        rank_tolerance=rank_tolerance,
    )

log_signature

log_signature(*, quotient: LieQuotient | None = None, filtration: ChronologicalFiltration | None = None, depths: tuple[int, ...] | None = None, rank_tolerance: float | None = None) -> LogSignaturePlan

Compile minimal local primitive coordinates.

Source code in src/tensorsig/offset_coded_signatures/plans.py
def log_signature(
    self,
    *,
    quotient: LieQuotient | None = None,
    filtration: ChronologicalFiltration | None = None,
    depths: tuple[int, ...] | None = None,
    rank_tolerance: float | None = None,
) -> LogSignaturePlan:
    """Compile minimal local primitive coordinates."""
    if not isinstance(self.mapping, OffsetCode):
        raise ValueError("Local logsignature plans require an OffsetCode.")
    rank_tolerance = _validate_rank_tolerance(rank_tolerance)
    if filtration is not None and not isinstance(
        filtration,
        ChronologicalFiltration,
    ):
        raise TypeError("filtration must be a ChronologicalFiltration or None.")
    selected_depths = _depths(self.max_depth, depths)
    if quotient is not None and filtration is not None:
        raise ValueError(
            "A coordinate filtration is not a Lie quotient; apply one or the other."
        )
    if quotient is None:
        return _compile_unquotiented_log(
            self,
            selected_depths,
            filtration,
            rank_tolerance,
        )
    if not isinstance(quotient, LieQuotient):
        raise TypeError("quotient must be a LieQuotient or None.")
    return _compile_quotiented_log(
        self,
        selected_depths,
        quotient,
        rank_tolerance,
    )