Skip to content

redsun.registry

Values every component may ask for

SessionConfig dataclass

SessionConfig(
    *,
    schema_version: float = 1.0,
    frontend: str | None = None,
    session: str = "Redsun",
    mock: bool = False,
    metadata: dict[str, object] = dict(),
)

The configuration an application was built from.

schema_version class-attribute instance-attribute

schema_version: float = 1.0

Format of the session file.

frontend class-attribute instance-attribute

frontend: str | None = None

Registered name of the frontend the session is built on, if any.

session class-attribute instance-attribute

session: str = 'Redsun'

Name of the session.

mock class-attribute instance-attribute

mock: bool = False

Whether the devices connect to simulated backends and no service starts.

metadata class-attribute instance-attribute

metadata: dict[str, object] = field(default_factory=dict)

What the session file asks to have recorded with the session.

DeviceMapping module-attribute

DeviceMapping: TypeAlias = Mapping[str, Device]

Every device an application built, by name.

Not ophyd-async's DeviceMap, which is a device holding string-keyed children; this is the application's own set.

CallbackType module-attribute

CallbackType: TypeAlias = (
    Callable[[str, Document], None] | DocumentRouter
)

A document callback: a DocumentRouter, or anything callable as (name, doc).

PlanEntry

Bases: TypedDict

A plan a component offers, and the document callbacks it requires.

Only plan is required.

plan instance-attribute

plan: Required[Callable[..., MsgGenerator[Any]]]

The plan, a generator function.

callbacks instance-attribute

callbacks: Sequence[CallbackType]

Callbacks the plan requires, run in this order before any a user attaches.

extendable instance-attribute

extendable: bool

Whether a user may attach callbacks. True when absent.

HasPlans

Bases: Protocol

A component offering plans.

plan_map

plan_map() -> Mapping[str, PlanEntry]

Return the plans this component offers, by plan name.

HasActions

Bases: Protocol

A component whose plans offer actions to take while they run.

actions property

actions: ActionManager

The actions of the component's plans.