Future Subarray Interface

Interfaces for subarray devices.

class ska_tango_base.future._subarray_interface.SubarrayInterface[source]

Bases: LRCMixin, AbstractSubarrayInterface

Provides the Tango interface for an SKA subarray device.

This class extends ObsInterface with the standard subarray command set and long running command (LRC) support via LRCMixin, which supplies a TaskExecutor-backed task_executor and the associated LRC attributes.

Subclasses must override the execute_* methods for each command and apply the submit_lrc_task() decorator to make them long running commands.

Observation state is driven by writing to the signals inherited from ObsInterface, primarily via _update_obs_state(). The started_* and completed_* callbacks on AbstractSubarrayInterface manage the command_in_progress portion of the observation state automatically when using submit_lrc_task().

Use AbstractSubarrayInterface directly only when you need to supply your own task_executor implementation (e.g. via ComponentManagerLRCMixin).

class ska_tango_base.future._subarray_interface.AbstractSubarrayInterface[source]

Bases: AbstractLRCMixin, ObsInterface

Provides the Tango interface for an SKA subarray.

This abstract class combines ObsInterface and AbstractLRCMixin that requires a concrete TaskExecutorProtocol to be provided via task_executor.

In most cases you should use SubarrayInterface instead, which bundles this class with LRCMixin and a TaskExecutorComponentManager-backed task executor. Use this abstract class only when you need to provide your own task_executor implementation (e.g. via ComponentManagerLRCMixin).

CapabilityTypes

Types of capability supported by this subarray.

SubID

Unique identifier for this subarray.

_activation_time

Signal for the activation time of the device.

Write to this signal to report the time of activation to Tango clients.

activationTime

Activation time attribute of the device.

This should be set by subclasses of this interface by writing to _activation_time.

assignedResources

The resources assigned to the device.

read_assignedResources() list[str][source]

Read the resources assigned to the device.

Subclasses of this interface must provide this method.

configuredCapabilities

The configured capabilities of the device.

For example, [“Correlators:512”, “PssBeams:4”, “PstBeams:4”, “VlbiBeams:0”].

read_configuredCapabilities() list[str][source]

Read the capabilities configured in the device.

Subclasses of this interface must provide this method.

read_activationTime() float | tuple[float, float, AttrQuality][source]

Read the activation time of the device.

Subclasses can override this to change the behaviour of the activationTime attribute.

is_activationTime_allowed(attr: AttReqType) bool[source]

Check if the activationTime can be read currently.

This can be overridden by subclasses to restrict when clients can access the attribute.

is_AssignResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether AssignResources() may be executed or enqueued.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_AssignResources(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard AssignResources command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make AssignResources a long running command.

  • Before calling this command, the device must be in obsState EMPTY or IDLE.

  • While this command is running, the device should have obsState RESOURCING.

  • Once this command has completed successfully, the device should have obsState IDLE.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the resources to be assigned

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

started_AssignResources() None[source]

AssignResources command started callback.

completed_AssignResources() None[source]

AssignResources command completed callback.

AssignResources(argin: str) tuple[list[ResultCode], list[str]][source]

Assign resources to this subarray.

Subclasses should override the execute_AssignResources method to change the behaviour of this command.

Parameters:

argin – the resources to be assigned

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_ReleaseResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether ReleaseResources() may be executed or enqueued.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_ReleaseResources(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard ReleaseResources command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make ReleaseResources a long running command.

  • Before calling this command, the device must be in obsState IDLE.

  • While this command is running, the device should have obsState RESOURCING.

  • Once this command has completed successfully, the device should have obsState IDLE or EMPTY depending on remaining resources.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the resources to be released

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

started_ReleaseResources() None[source]

ReleaseResources command started callback.

completed_ReleaseResources() None[source]

ReleaseResources command completed callback.

ReleaseResources(argin: str) tuple[list[ResultCode], list[str]][source]

Delta removal of assigned resources.

Subclasses should override the execute_ReleaseResources method to change the behaviour of this command.

Parameters:

argin – the resources to be released

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_ReleaseAllResources_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the ReleaseAllResources() command may be called.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_ReleaseAllResources() tuple[list[ResultCode], list[str]][source]

Execute the standard ReleaseAllResources command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make ReleaseAllResources a long running command.

  • Before calling this command, the device must be in obsState IDLE.

  • While this command is running, the device should have obsState RESOURCING.

  • Once this command has completed successfully, the device should have obsState EMPTY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

started_ReleaseAllResources() None[source]

ReleaseAllResources command started callback.

completed_ReleaseAllResources() None[source]

ReleaseAllResources command completed callback.

ReleaseAllResources() tuple[list[ResultCode], list[str]][source]

Remove all resources to tear down to an empty subarray.

Subclasses should override the execute_ReleaseAllResources method to change the behaviour of this command.

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_Configure_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the Configure() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_Configure(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard Configure command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Configure a long running command.

  • Before calling this command, the device must be in obsState IDLE or READY.

  • While this command is running, the device should have obsState CONFIGURING.

  • Once this command has completed successfully, the device should have obsState READY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the scan configuration specification

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

started_Configure() None[source]

Configure command started callback.

completed_Configure() None[source]

Configure command completed callback.

Configure(argin: str) tuple[list[ResultCode], list[str]][source]

Configure the capabilities of this subarray.

Subclasses should override the execute_Configure method to change the behaviour of this command.

Parameters:

argin – the scan configuration specification

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_Scan_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the Scan() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_Scan(argin: str) tuple[list[ResultCode], list[str]][source]

Execute the standard Scan command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Scan a long running command.

  • Before calling this command, the device must be in obsState READY.

  • Once this command has completed successfully, the device should have obsState SCANNING.

  • If this command does not complete successfully, the device should have obsState FAULT.

Parameters:

argin – the per-scan configuration

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

Scan(argin: str) tuple[list[ResultCode], list[str]][source]

Start scanning.

Subclasses should override the execute_Scan method to change the behaviour of this command.

Parameters:

argin – the per-scan configuration

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_EndScan_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the EndScan() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_EndScan() tuple[list[ResultCode], list[str]][source]

Execute the standard EndScan command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make EndScan a long running command.

  • Before calling this command, the device must be in obsState SCANNING.

  • Once this command has completed successfully, the device should have obsState READY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

EndScan() tuple[list[ResultCode], list[str]][source]

End the scan.

Subclasses should override the execute_EndScan method to change the behaviour of this command.

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_End_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the End() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_End() tuple[list[ResultCode], list[str]][source]

Execute the standard End command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make End a long running command.

  • Before calling this command, the device must be in obsState READY.

  • Once this command has completed successfully, the device should have obsState IDLE.

  • If this command does not complete successfully, the device should have obsState FAULT

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

End() tuple[list[ResultCode], list[str]][source]

End the scan block.

Subclasses should override the execute_End method to change the behaviour of this command.

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

is_Restart_allowed(request_type: LRCReqType | None = None) bool[source]

Return whether the Restart() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Parameters:

request_type – ENQUEUE_REQ when the LRC is enqueued by the Tango command and EXECUTE_REQ when the LRC is about to be executed by the executor.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

execute_Restart() tuple[list[ResultCode], list[str]][source]

Execute the standard Restart command.

This method must be overridden by all subclasses. The submit_lrc_task() decorator can be used to make Restart a long running command.

  • Before calling this command, the device must be in obsState FAULT or ABORTED.

  • While this command is running, the device should have obsState RESTARTING.

  • Once this command has completed successfully, the device should have obsState EMPTY.

  • If this command does not complete successfully, the device should have obsState FAULT.

Returns:

A tuple containing a return code and a string message indicating status or a command ID. The message is for information purpose only.

started_Restart() None[source]

Restart command started callback.

completed_Restart() None[source]

Restart command completed callback.

Restart() tuple[list[ResultCode], list[str]][source]

Restart the subarray. That is, deconfigure and release all resources.

Subclasses should override the execute_Restart method to change the behaviour of this command.

Returns:

A tuple containing a result code and the unique ID of the command

is_Abort_allowed() bool[source]

Return whether the Abort() command may be called currently.

This method can be overridden by subclasses to change when this command is allowed.

Raises:

StateModelError – command not permitted in observation state

Returns:

whether the command may be called in the current device state

started_Abort() None[source]

Abort command started callback.

completed_Abort() None[source]

Abort command completed callback.