Future API

The future module provides a new API that will replace the deprecated API.

All public classes, functions, decorators and exceptions provided by the SKA Tango Base package are exposed flat from this module, with the exception of type_hints and utils, which are submodules of future and the root package.

Imports from anywhere else in the package are deprecated and strongly discouraged, as most submodules will be made private in the 2.0.0 release, thereby breaking almost all existing imports.

It is recommended to use the new API by only importing this module directly as stb to prevent any namespace collisions:

import ska_tango_base.future as stb

Using it like this will only require updating a single import statement when migrating to the 2.0.0 release which will make the future module the root of ska_tango_base.

Here follows what is provided by the future API:

Submodules

Class hierarchy cheat sheet

@startuml
hide empty members
left to right direction

package "Core device interfaces" {
    class SKADevice
    class SignalBusMixin
    class OpStateEmitMixin
    class BaseInterface
    class PoweredOpStateEmitMixin
    class PoweredInterface
    class ControllerInterface
    class ObsStateEmitMixin
    class ObsInterface
    abstract class AbstractSubarrayInterface
    class SubarrayInterface

    SignalBusMixin --|> SKADevice
    OpStateEmitMixin --|> SharingObserver
    BaseInterface --|> OpStateEmitMixin
    BaseInterface --|> SignalBusMixin

    PoweredOpStateEmitMixin --|> SharingObserver
    PoweredInterface --|> PoweredOpStateEmitMixin
    PoweredInterface --|> BaseInterface

    ControllerInterface --|> BaseInterface

    ObsStateEmitMixin --|> SharingObserver
    ObsInterface --|> ObsStateEmitMixin
    ObsInterface --|> BaseInterface

    AbstractSubarrayInterface --|> AbstractLRCMixin
    AbstractSubarrayInterface --|> ObsInterface
    SubarrayInterface --|> LRCMixin
    SubarrayInterface --|> AbstractSubarrayInterface
}

package "Optional device mixins" {
    abstract class AbstractLRCMixin
    class LRCMixin
    class ComponentManagerMixin
    class ComponentManagerLRCMixin
    class ControlModeMixin
    class CallbackSchedulerMixin
    class HeritableAdminModeMixin

    LRCMixin --|> AbstractLRCMixin
    ComponentManagerMixin --|> SignalBusMixin
    ComponentManagerLRCMixin --|> ComponentManagerMixin
    ComponentManagerLRCMixin --|> AbstractLRCMixin
    ControlModeMixin --|> BaseInterface
    CallbackSchedulerMixin --|> SKADevice
    HeritableAdminModeMixin --|> CallbackSchedulerMixin
    HeritableAdminModeMixin --|> BaseInterface
}

package "Component-manager support" {
    class SharingObserver
    class TaskExecutorComponentManager
}

note bottom of BaseInterface
    Minimal device interface:
    operational state, admin mode,
    health, and signal bus.
end note

note bottom of SubarrayInterface
    Standard subarray choice:
    includes an LRCMixin and
    a device-owned TaskExecutor.
end note

note right of ComponentManagerLRCMixin
    Use instead of ComponentManagerMixin
    + LRCMixin when the component manager
    owns the TaskExecutor.
end note

note as combinations
Typical valid device combinations:

1. BaseInterface
2. LRCMixin + BaseInterface
3. ComponentManagerMixin + BaseInterface
4. ComponentManagerMixin + LRCMixin + PoweredInterface
5. ComponentManagerLRCMixin + BaseInterface
6. ComponentManagerMixin + SubarrayInterface
7. ComponentManagerLRCMixin + AbstractSubarrayInterface
8. ControlModeMixin and/or HeritableAdminModeMixin
    before a compatible interface
end note

combinations .. BaseInterface
combinations .. ComponentManagerMixin
combinations .. LRCMixin
combinations .. ComponentManagerLRCMixin
combinations .. SubarrayInterface

note bottom of TaskExecutorComponentManager
    Required component-manager base when using
    ComponentManagerLRCMixin. Combine it with
    OpStateEmitMixin, PoweredOpStateEmitMixin,
    and/or ObsStateEmitMixin as appropriate.
end note
@enduml