Skip to content

Enumerate nested devices in plan schemas #1129

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: rest apiREST API changesc: uiTickets involved in producing a JSONForms UI from the plan schemasdecision pendingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions