pcdsdevices.utils.reorder_components

pcdsdevices.utils.reorder_components(cls: type[Device] | None = None, start_with: list[str | Cpt] | None = None, end_with: list[str | Cpt] | None = None) type[Device] | Callable[[type[Device]], type[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.