Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DiamondJoseph opened this issue Jun 25, 2024 · 1 comment
Assignees
Labels
cli Relates to CLI code python Pull requests that update Python code rest api Potential REST API changes

Comments

@DiamondJoseph
Copy link
Collaborator

DiamondJoseph commented Jun 25, 2024

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"}})

@DiamondJoseph
Copy link
Collaborator Author

DiamondJoseph commented Jun 25, 2024

Note that the "idiomatic way" does not work

class MyComposite(BlueapiBaseModel):
    x: Motor = inject("x")
    y: Motor = inject("y")
    det: Eiger = inject("det1")```

@DiamondJoseph DiamondJoseph self-assigned this Jul 4, 2024
@DiamondJoseph DiamondJoseph added python Pull requests that update Python code rest api Potential REST API changes cli Relates to CLI code labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Relates to CLI code python Pull requests that update Python code rest api Potential REST API changes
Projects
None yet
Development

No branches or pull requests

1 participant