pcdsdevices.utils.reorder_components

pcdsdevices.utils.reorder_components(cls: Optional[type[ophyd.device.Device]] = None, start_with: Optional[List[Union[str, Component]]] = None, end_with: Optional[List[Union[str, Component]]] = None) Union[type[ophyd.device.Device], Callable[[type[ophyd.device.Device]], type[ophyd.device.Device]]]

Rearrange the components in cls for typhos displays.

Internally, this works by switching around the keys in the _sig_attrs OrderedDict.

Parameters
  • cls (Device subclass) – The Device subclass that we’d like to rearrange the order of.

  • start_with (list of str, optional) – The component names to bring to the top of the screen.

  • end_with (list of str, optional) – The component names to bring to the bottom of the screen.

Returns

cls (Device subclass, or function that returns it) – Decorator-compatible output. When used as a function or as a no-argument decorator, this will return the input device. When used as a decorator with the reverse argument, this will return a function as required by the decorator interface.