Skip to content

Support plan parameters of TypedDict, Dataclass, BaseModel that include devices, collections of devices #523

Closed

Description

@DiamondJoseph

Extends #506

Plans that have parameters of e.g.

def foo_plan(thing: TypedThing):
  ...

where

class TypedThing(TypedDict):
  x: Readable

or

@dataclass
class TypedThing:
  x: Readable

or

class TypedThing(BaseModel):
  x: Readable

Should be able to have their schemas generated and presented from /plans, and these plans should be runnable with x being passed as a reference to a device (i.e. parameters = {"thing": {"x": "stage_x"}})

Activity

  1. DiamondJoseph commented on Jun 25, 2024

    @DiamondJoseph
    ContributorAuthor

    Note that the "idiomatic way" does not work

    class MyComposite(BlueapiBaseModel):
        x: Motor = inject("x")
        y: Motor = inject("y")
        det: Eiger = inject("det1")```
  2. self-assigned this
    on Jul 4, 2024
  3. added
    c: rest api
    c: cli
    on Jul 4, 2024
  4. abbiemery commented on Feb 25, 2026

    @abbiemery
    Contributor

    Base models and dataclasses are both now supported. TypedDicts can be revisited if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: clic: rest api

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions