Rendering and presets¶
Use anihmm.render for frame rendering and geometry.
anihmm.render
¶
Low-level lattice rendering and transition geometry.
cells_from_mask
¶
cells_from_mask(
mask: str,
*,
markers: set[str] | frozenset[str] = MASK_MARKERS,
) -> set[GridCell]
Convert marked characters in a dedented text mask to grid coordinates.
flash_overlay_cells
¶
Return the glyph overlay used to flash a lattice node.
lattice_guide
¶
Return a numbered plain-text guide for lattice cell coordinates.
render_frame
¶
Render an :class:HMMFrame as a stable-height Rich group.
transition_cells
¶
Return lattice cells belonging to one supported state transition.
Use anihmm.presets for built-in demo and random paths.
anihmm.presets
¶
Built-in deterministic and random animation presets.
build_demo_frames
¶
build_demo_frames(
*,
columns: int = DEMO_COLUMNS,
seed: int | None = DEMO_SEED,
) -> list[HMMFrame]
Build the deterministic demo, shortening its label for small lattices.
build_random_frames
¶
build_random_frames(
*,
columns: int = 5,
seed: int | None = None,
emissions: EmissionSpec = None,
) -> list[HMMFrame]
Build a start frame and compiled frames for a finite random path.
build_random_path_frame
¶
build_random_path_frame(
*,
columns: int = 5,
seed: int | None = None,
emissions: EmissionSpec = None,
) -> HMMFrame
Return the final settled frame from a generated random path.
build_random_steps
¶
build_random_steps(
*,
columns: int = 5,
seed: int | None = None,
emissions: EmissionSpec = None,
) -> list[Step]
Build a finite random semantic path through a bounded HMM lattice.
extend_frames
¶
Return a new frame list containing existing followed by new_frames.