Skip to content

Builders

These functions are the shortest path from domain data or a backend session class to a runnable app.

Surface and Replay Builders

surface

Functions:

Name Description
grid_field

Create a Field/GridGeometry pair from a 2-D array and coordinate vectors.

build_surface_app

Build a static surface app from field data, optional geometry, and views.

grid_field

grid_field(
    *,
    field_id: str,
    values: ndarray,
    x_coords: ndarray,
    y_coords: ndarray,
    x_dim: str = "x",
    y_dim: str = "y",
    unit: str | None = None,
) -> tuple[Field, GridGeometry]

Create a Field/GridGeometry pair from a 2-D array and coordinate vectors.

build_surface_app

build_surface_app(
    *,
    field: Field,
    geometry: GridGeometry | None = None,
    title: str = "Surface",
    surface_view: SurfaceViewSpec | None = None,
    line_views: tuple[LinePlotViewSpec, ...] = (),
    operators: dict[str, OperatorSpec] | None = None,
    controls: dict[str, ControlSpec] | None = None,
    panels: tuple[PanelSpec, ...] = (),
    panel_grid: tuple[tuple[str, ...], ...] = (),
) -> AppSpec

Build a static surface app from field data, optional geometry, and views.

replay

Classes:

Name Description
ReplaySession

Session that replays a precomputed sequence of frame replacements.

Functions:

Name Description
build_replay_app

Build an app that replays precomputed frames through ReplaySession.

ReplaySession

ReplaySession(
    *,
    scene: Scene,
    field_id: str,
    frames,
    interval_live: bool = True,
)

Bases: BufferedSession

Session that replays a precomputed sequence of frame replacements.

Methods:

Name Description
initialize
is_live
advance
handle
startup_scene
read_updates
idle_sleep
shutdown
emit

Attributes:

Name Type Description
scene
field_id
frames
index
interval_live

scene instance-attribute

scene = scene

field_id instance-attribute

field_id = field_id

frames instance-attribute

frames = list(frames)

index instance-attribute

index = 0

interval_live instance-attribute

interval_live = interval_live

initialize

initialize()

is_live

is_live() -> bool

advance

advance() -> None

handle

handle(command) -> None

startup_scene classmethod

startup_scene() -> Scene | None

read_updates

read_updates() -> list[SessionUpdate]

idle_sleep

idle_sleep() -> float

shutdown

shutdown() -> None

emit

emit(update: SessionUpdate) -> None

build_replay_app

build_replay_app(
    *, scene: Scene, field_id: str, frames
) -> AppSpec

Build an app that replays precomputed frames through ReplaySession.

Live Backend Builders

neuron

Functions:

Name Description
build_neuron_app

Build a live app backed by a NeuronSession subclass or session factory.

build_neuron_app

build_neuron_app(
    session: SessionSource,
    *,
    title: str | None = None,
    interaction_target=None,
) -> AppSpec

Build a live app backed by a NeuronSession subclass or session factory.

jaxley

Functions:

Name Description
build_jaxley_app

Build a live app backed by a JaxleySession subclass or session factory.

build_jaxley_app

build_jaxley_app(
    session: SessionSource,
    *,
    title: str | None = None,
    interaction_target=None,
) -> AppSpec

Build a live app backed by a JaxleySession subclass or session factory.