Skip to content

Enumerate nested devices in plan schemas #1129

@callumforrester

Description

@callumforrester

Following #526 plan schemas include enums of all possible devices that can be supplied, for example:

{
  "bump_motor": {
    "additionalProperties": false,
    "description": "",
    "properties": {
      "motor": {
        "description": "",
        "enum": [
          "x",
          "y"
        ],
        "title": "Motor",
        "type": "bluesky.protocols.Movable"
      }
    }
  }
}

However, if devices are nested they are not picked up by this process, so if I have

class SimStage(StandardReadable):
    def __init__(self, name: str = "") -> None:
        with self.add_children_as_readables():
            self.x = Motor("BAZ:")
            self.y = Motor("BLARG:")
        super().__init__(name)

It does not appear, I would expect something like

{
  "bump_motor": {
    "additionalProperties": false,
    "description": "",
    "properties": {
      "motor": {
        "description": "",
        "enum": [
          "sim_stage.x",
          "sim_stage.y"
        ],
        "title": "Motor",
        "type": "bluesky.protocols.Movable"
      }
    }
  }
}

I have created a failing test in #1127

Acceptance Criteria

  • Nested devices are included in enums
  • Failing test linked above passes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjson formsTickets involved in producing a JSONForms UI from the plan schemasrest apiPotential REST API changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions