Skip to content

Sequence API

Use this namespace to build custom paths or compile Step objects directly.

anihmm.sequence

Semantic HMM sequence construction and frame compilation.

HMMSequence

Stateful builder for semantic HMM animation steps.

columns property

columns: int | None

Configured lattice bound, or None for an unbounded sequence.

committed property

committed: list[Transition]

Copy of the committed transition path.

current_node property

current_node: str

Current settled node identifier.

emissions property

emissions: list[str]

Copy of the accumulated emission entries.

steps property

steps: list[Step]

Copy of the semantic steps constructed so far.

__init__

__init__(
    *, start: str = "S", columns: int | None = None
) -> None

Create a sequence at a canonical node with optional bounds.

build

build() -> list[Step]

Return a copy of the semantic steps built so far.

cycle

cycle(
    kind: str, *, title: str | None = None
) -> HMMSequence

Add a transient preview of the next state without committing it.

emit

emit(
    symbol: str, *, title: str | None = None
) -> HMMSequence

Emit one visible terminal-cell symbol from the current state.

finish

finish(*, title: str | None = None) -> HMMSequence

Fill remaining bounded columns with deletions, then commit E.

flash_current

flash_current(*, title: str | None = None) -> HMMSequence

Add a transient flash overlay to the current state.

settle

settle(
    kind: str, *, title: str | None = None
) -> HMMSequence

Commit a transition to the next state of kind.

Step dataclass

Semantic description of one animation beat.

compile_step

compile_step(
    step: Step, *, columns: int | None = None
) -> HMMFrame

Compile one semantic step into a renderable frame description.

compile_steps

compile_steps(
    steps: Iterable[Step], *, columns: int | None = None
) -> list[HMMFrame]

Compile semantic steps with a shared explicit or inferred column count.