pcdsdevices.utils.sort_components_by_name
- pcdsdevices.utils.sort_components_by_name(cls: Optional[type[ophyd.device.Device]] = None, reverse: bool = False) Union[type[ophyd.device.Device], Callable[[type[ophyd.device.Device]], type[ophyd.device.Device]]]
Arrange the component order of a device class in alphabetical order.
This can be useful as a first step before bringing specific components to the top of the queue for the typhos screen.
- Parameters
cls (Device subclass) – The Device subclass that we’d like to rearrange the order of.
reverse (bool, optional) – Set to True to sort in descending order instead.
- 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.