diff --git a/tangostationcontrol/integration_test/default/devices/base.py b/tangostationcontrol/integration_test/default/devices/base.py index 377b22df6d6210f030090362c26a3e8ff9d2911d..486b4407f7a2405adb85dcf6296fdb004f6e623a 100644 --- a/tangostationcontrol/integration_test/default/devices/base.py +++ b/tangostationcontrol/integration_test/default/devices/base.py @@ -3,7 +3,7 @@ from tango._tango import DevState, AttrWriteType -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice from integration_test import base from integration_test.device_proxy import TestDeviceProxy diff --git a/tangostationcontrol/integration_test/default/devices/interfaces/__init__.py b/tangostationcontrol/integration_test/default/devices/base_device_classes/__init__.py similarity index 100% rename from tangostationcontrol/integration_test/default/devices/interfaces/__init__.py rename to tangostationcontrol/integration_test/default/devices/base_device_classes/__init__.py diff --git a/tangostationcontrol/integration_test/default/devices/interfaces/test_power_hierarchy.py b/tangostationcontrol/integration_test/default/devices/base_device_classes/test_power_hierarchy.py similarity index 99% rename from tangostationcontrol/integration_test/default/devices/interfaces/test_power_hierarchy.py rename to tangostationcontrol/integration_test/default/devices/base_device_classes/test_power_hierarchy.py index 9b6433683c8199aed97d106bca086f035e0ddec8..20716f4beb5ef2d7573a97dad9abfa3024c05b2b 100644 --- a/tangostationcontrol/integration_test/default/devices/interfaces/test_power_hierarchy.py +++ b/tangostationcontrol/integration_test/default/devices/base_device_classes/test_power_hierarchy.py @@ -6,7 +6,9 @@ Power Hierarchy module integration test """ from tango import DevState, DeviceProxy -from tangostationcontrol.devices.interfaces.power_hierarchy import PowerHierarchy +from tangostationcontrol.devices.base_device_classes.power_hierarchy import ( + PowerHierarchy, +) from integration_test import base from integration_test.device_proxy import TestDeviceProxy diff --git a/tangostationcontrol/tangostationcontrol/devices/antennafield.py b/tangostationcontrol/tangostationcontrol/devices/antennafield.py index e408613cb53a39f6b1c6b62ba10e8bbca29b348c..fb1ff7dfc8f88c9bbb9d96ab1b4f08750d5406df 100644 --- a/tangostationcontrol/tangostationcontrol/devices/antennafield.py +++ b/tangostationcontrol/tangostationcontrol/devices/antennafield.py @@ -50,7 +50,7 @@ from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.common.type_checking import type_not_sequence from tangostationcontrol.common.antennas import antenna_set_to_mask from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice from tangostationcontrol.devices.types import DeviceTypes logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/aps.py b/tangostationcontrol/tangostationcontrol/devices/aps.py index 4dd80fc17c102a26e50bba49ac31f12afd9031da..5e4b21073dba03c9ee514e1d9aaa623bf6302101 100644 --- a/tangostationcontrol/tangostationcontrol/devices/aps.py +++ b/tangostationcontrol/tangostationcontrol/devices/aps.py @@ -8,7 +8,7 @@ # PyTango imports from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/devices/apsct.py b/tangostationcontrol/tangostationcontrol/devices/apsct.py index a0274ea5bdcb52194c40b07608662b239d698ec9..37747940d92f60700e140afcfa923861d8b4abd2 100644 --- a/tangostationcontrol/tangostationcontrol/devices/apsct.py +++ b/tangostationcontrol/tangostationcontrol/devices/apsct.py @@ -19,7 +19,7 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/devices/apspu.py b/tangostationcontrol/tangostationcontrol/devices/apspu.py index 590fd63b88c9663c863b92644f8fe35e15a9d242..fd89a2796809d0c0afc65f98d5b4fc6f29088656 100644 --- a/tangostationcontrol/tangostationcontrol/devices/apspu.py +++ b/tangostationcontrol/tangostationcontrol/devices/apspu.py @@ -14,7 +14,7 @@ from tango.server import attribute, device_property from tangostationcontrol.common.constants import DEFAULT_POLLING_PERIOD from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/devices/base_device_classes/__init__.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..68ddd5cdc3efaa38e853aef337c08beb99c50c4c --- /dev/null +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/async_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/async_device.py similarity index 94% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/async_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/async_device.py index d5da4f3d3229a735fec0df86f2cdaf26e7c45d69..1ea990a7f861a7acc828ee9f1f605f7939252c0d 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/async_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/async_device.py @@ -6,7 +6,7 @@ from tango import GreenMode from tango.server import Device -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice __all__ = ["AsyncDevice"] diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/beam_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/beam_device.py similarity index 99% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/beam_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/beam_device.py index 06b7dc8bc2c27ca3289cee452f3cc968812c1e7d..7a19a17fabe9b858bbd6b39a64fe6556f1875de0 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/beam_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/beam_device.py @@ -45,7 +45,8 @@ from tangostationcontrol.devices.device_decorators import ( only_in_states, fault_on_error, ) -from tangostationcontrol.devices.interfaces.async_device import AsyncDevice + +from tangostationcontrol.devices.base_device_classes.async_device import AsyncDevice __all__ = ["BeamDevice", "main", "BeamTracker"] diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/clock_hierarchy.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/clock_hierarchy.py similarity index 89% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/clock_hierarchy.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/clock_hierarchy.py index 76527afeb8108db72ca21966b5f658a6e0e703d2..6a72c6ad0f96a328f4982ecbc1a9ab3781960a70 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/clock_hierarchy.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/clock_hierarchy.py @@ -8,7 +8,7 @@ from typing import Optional from tango import DeviceProxy -from tangostationcontrol.devices.interfaces.hierarchy_device import ( +from tangostationcontrol.devices.base_device_classes.hierarchy_device import ( AbstractHierarchyDevice, ) diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/control_hierarchy.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/control_hierarchy.py similarity index 88% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/control_hierarchy.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/control_hierarchy.py index e5fd0a84b6fa972332aaeac81fd54b4563d92a36..1a929f3c98335bc6465f3784d9a739b1cf1c7d50 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/control_hierarchy.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/control_hierarchy.py @@ -7,7 +7,7 @@ from typing import Optional from tango import DeviceProxy -from tangostationcontrol.devices.interfaces.hierarchy_device import ( +from tangostationcontrol.devices.base_device_classes.hierarchy_device import ( AbstractHierarchyDevice, ) diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/hierarchy.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/hierarchy.py similarity index 97% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/hierarchy.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/hierarchy.py index 7601487e5477f7ece2aaeffe38cd4a56dfc0e4b6..c233be8c02f93a6231cd7f53deab9c665f985699 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/hierarchy.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/hierarchy.py @@ -233,8 +233,8 @@ class AbstractHierarchy(ABC): def _children_names( self, child_filter_str: str, - children: children_type, child_filter_func: child_filter_func_type, + children: children_type, ) -> List[str]: """Return children names matching child_filter substring @@ -257,7 +257,7 @@ class AbstractHierarchy(ABC): device_names.extend( self._children_names( - child_filter_str, data["children"], child_filter_func + child_filter_str, child_filter_func, data["children"] ) ) @@ -279,14 +279,14 @@ class AbstractHierarchy(ABC): child_filter = child_filter.value return self._children_names( - child_filter, self.children(depth=-1), self._get_filter(filter_type) + child_filter, self._get_filter(filter_type), self.children(depth=-1) ) def _child( self, child_filter_str: str, - children: children_type, child_filter_func: child_filter_func_type, + children: children_type, ) -> Optional[DeviceProxy]: """Recurse :attr:`~children` to find device and return it @@ -300,7 +300,7 @@ class AbstractHierarchy(ABC): if not data["children"]: continue - result = self._child(child_filter_str, data["children"], child_filter_func) + result = self._child(child_filter_str, child_filter_func, data["children"]) if result: return result @@ -329,7 +329,7 @@ class AbstractHierarchy(ABC): child_filter = child_filter.value child = self._child( - child_filter, self.children(depth=-1), self._get_filter(filter_type) + child_filter, self._get_filter(filter_type), self.children(depth=-1) ) if not child: diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/hierarchy_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/hierarchy_device.py similarity index 96% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/hierarchy_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/hierarchy_device.py index a8d04c5e2751806f531d424e2ed3598774526e11..30f485b902f9fdb0d5880ac1d4dfeedfad6c0eea 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/hierarchy_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/hierarchy_device.py @@ -12,8 +12,10 @@ from tango import Database from tango import DevState from tango import DeviceProxy -from tangostationcontrol.devices.interfaces.hierarchy import AbstractHierarchy -from tangostationcontrol.devices.interfaces.hierarchy import HierarchyMatchingFilter +from tangostationcontrol.devices.base_device_classes.hierarchy import AbstractHierarchy +from tangostationcontrol.devices.base_device_classes.hierarchy import ( + HierarchyMatchingFilter, +) logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/lofar_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py similarity index 99% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/lofar_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py index a197c966dd2a8b0d8b8cd1d5a78c8be81629a34d..d2d6c76386ca30762849ca6463e02745b717a206 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/lofar_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/lofar_device.py @@ -33,7 +33,7 @@ from tangostationcontrol.common.states import ( from tangostationcontrol.common.proxy import create_device_proxy from tangostationcontrol.common.type_checking import sequence_not_str from tangostationcontrol.devices.device_decorators import only_in_states, fault_on_error -from tangostationcontrol.devices.interfaces.control_hierarchy import ( +from tangostationcontrol.devices.base_device_classes.control_hierarchy import ( ControlHierarchyDevice, ) diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/opcua_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/opcua_device.py similarity index 98% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/opcua_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/opcua_device.py index 8355dfcae46f4b88ef1f9aaa67e918ccb417a407..1462c7a1015528b1fd1e91bf6bca754ca8b43d2c 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/opcua_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/opcua_device.py @@ -18,7 +18,7 @@ from tangostationcontrol.clients.opcua_client import ( OPCUAConnectionStatus, ) from tangostationcontrol.common.lofar_logging import log_exceptions, exception_to_str -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/power_hierarchy.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/power_hierarchy.py similarity index 99% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/power_hierarchy.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/power_hierarchy.py index ccf8892e730447c1d38dfa66bf39b7df89903c49..dba7167b76f78c99944a96b2525865137cd69e40 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/power_hierarchy.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/power_hierarchy.py @@ -8,14 +8,15 @@ import logging from tango import DeviceProxy, DevState +from tangostationcontrol.devices.base_device_classes.hierarchy_device import ( + AbstractHierarchyDevice, +) from tangostationcontrol.common.states import ( StationState, run_if_device_on_in_station_state, ) from tangostationcontrol.common.type_checking import device_class_matches -from tangostationcontrol.devices.interfaces.hierarchy_device import ( - AbstractHierarchyDevice, -) + from tangostationcontrol.devices.device_decorators import suppress_exceptions logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/recv_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py similarity index 99% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/recv_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py index d7d04f454209ea09e29c6823e99293c4ec2a3019..4cc158e68cd73d8a7ab6770b211753dd4d8770b6 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/recv_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/recv_device.py @@ -25,7 +25,7 @@ from tangostationcontrol.common.frequency_bands import bands from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/snmp_device.py b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/snmp_device.py similarity index 97% rename from tangostationcontrol/tangostationcontrol/devices/interfaces/snmp_device.py rename to tangostationcontrol/tangostationcontrol/devices/base_device_classes/snmp_device.py index 2d44901117847141ff80f6f9b1cce4a1f2dc729a..9d74be02eda37ddbdab34aca0f264cc60e506183 100644 --- a/tangostationcontrol/tangostationcontrol/devices/interfaces/snmp_device.py +++ b/tangostationcontrol/tangostationcontrol/devices/base_device_classes/snmp_device.py @@ -24,7 +24,7 @@ from tangostationcontrol.common.lofar_logging import ( ) # Additional import -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice debug.setLogger(debug.Debug("searcher", "compiler", "borrower", "reader")) diff --git a/tangostationcontrol/tangostationcontrol/devices/boot.py b/tangostationcontrol/tangostationcontrol/devices/boot.py index 2f86b812b1b36b0acf3721c6a10ee7e7904b9158..f08f23d702119ff15b2e314b55fc076dbeda0b55 100644 --- a/tangostationcontrol/tangostationcontrol/devices/boot.py +++ b/tangostationcontrol/tangostationcontrol/devices/boot.py @@ -26,7 +26,7 @@ from tangostationcontrol.common.lofar_logging import ( from tangostationcontrol.common.proxy import create_device_proxy from tangostationcontrol.common.states import OPERATIONAL_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/calibration.py b/tangostationcontrol/tangostationcontrol/devices/calibration.py index d4cfe7fcd7867bdddb7687fdce348808904e1df7..115facc8fbf2f0441f1b9605a768996babbe42f4 100644 --- a/tangostationcontrol/tangostationcontrol/devices/calibration.py +++ b/tangostationcontrol/tangostationcontrol/devices/calibration.py @@ -23,7 +23,7 @@ from tangostationcontrol.common.proxy import create_device_proxy from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.antennafield import AntennaField from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice from tangostationcontrol.devices.sdp.sdp import SDP from tangostationcontrol.devices.sdp.firmware import SDPFirmware diff --git a/tangostationcontrol/tangostationcontrol/devices/ccd.py b/tangostationcontrol/tangostationcontrol/devices/ccd.py index 88c587451ea3e29eda5b66d1750500d20a839d05..5c5e9ddf052624439c4f8c9b1eedc2119c04aa18 100644 --- a/tangostationcontrol/tangostationcontrol/devices/ccd.py +++ b/tangostationcontrol/tangostationcontrol/devices/ccd.py @@ -19,7 +19,7 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/devices/configuration.py b/tangostationcontrol/tangostationcontrol/devices/configuration.py index 8fd7451a90bb6301b78dd2a1cf44c3c5995601b5..3de99aaaa88b0ada268a02e95b6fd218230eae40 100644 --- a/tangostationcontrol/tangostationcontrol/devices/configuration.py +++ b/tangostationcontrol/tangostationcontrol/devices/configuration.py @@ -22,7 +22,7 @@ from tangostationcontrol.common.lofar_logging import ( ) from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/docker.py b/tangostationcontrol/tangostationcontrol/devices/docker.py index 071f0010e801bc8e3860ac03a7f27045280524ac..4778b61aa86a1cdb5ab17448651767428d5ee5f3 100644 --- a/tangostationcontrol/tangostationcontrol/devices/docker.py +++ b/tangostationcontrol/tangostationcontrol/devices/docker.py @@ -20,7 +20,7 @@ from tangostationcontrol.common.lofar_logging import ( device_logging_to_python, log_exceptions, ) -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/ec.py b/tangostationcontrol/tangostationcontrol/devices/ec.py index ecf59482efea4626dbc1708ac4ebd65f8175b305..d466361e18d2d6e35b55cbd3d5f6b6b0b75a368b 100644 --- a/tangostationcontrol/tangostationcontrol/devices/ec.py +++ b/tangostationcontrol/tangostationcontrol/devices/ec.py @@ -14,7 +14,7 @@ from tango import AttrWriteType # PyTango imports from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/devices/interfaces/__init__.py b/tangostationcontrol/tangostationcontrol/devices/interfaces/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/tangostationcontrol/tangostationcontrol/devices/observation.py b/tangostationcontrol/tangostationcontrol/devices/observation.py index 69aef603bee6b5c052a4d29827923db60eb6b905..1af5658757367f513649cc6367ec5a7d417d2967 100644 --- a/tangostationcontrol/tangostationcontrol/devices/observation.py +++ b/tangostationcontrol/tangostationcontrol/devices/observation.py @@ -25,7 +25,7 @@ from tangostationcontrol.configuration import ObservationSettings from tangostationcontrol.devices.device_decorators import fault_on_error from tangostationcontrol.devices.device_decorators import only_in_states from tangostationcontrol.devices.device_decorators import only_when_on -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/observation_control.py b/tangostationcontrol/tangostationcontrol/devices/observation_control.py index 38add1357409ae053cb0ce85e298c416838ba8a1..3cb53961a88b3e6d8e19f84d287335484a864406 100644 --- a/tangostationcontrol/tangostationcontrol/devices/observation_control.py +++ b/tangostationcontrol/tangostationcontrol/devices/observation_control.py @@ -22,7 +22,7 @@ from tangostationcontrol.common.lofar_logging import ( ) from tangostationcontrol.configuration import ObservationSettings from tangostationcontrol.devices.device_decorators import only_when_on, fault_on_error -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice from tangostationcontrol.devices.observation import Observation logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/pcon.py b/tangostationcontrol/tangostationcontrol/devices/pcon.py index 5a171e49805d510867451bf4d84b83cc9861bc95..2eccc0a487de31ec3ed0a55a005f28157d426555 100644 --- a/tangostationcontrol/tangostationcontrol/devices/pcon.py +++ b/tangostationcontrol/tangostationcontrol/devices/pcon.py @@ -17,7 +17,7 @@ from tangostationcontrol.common.lofar_logging import ( device_logging_to_python, log_exceptions, ) -from tangostationcontrol.devices.interfaces.snmp_device import SNMPDevice +from tangostationcontrol.devices.base_device_classes.snmp_device import SNMPDevice from tangostationcontrol.clients.snmp.attribute_classes import PCON_sim debug.setLogger(debug.Debug("searcher", "compiler", "borrower", "reader")) diff --git a/tangostationcontrol/tangostationcontrol/devices/psoc.py b/tangostationcontrol/tangostationcontrol/devices/psoc.py index 1104c68406d7497177e69f4e4b44c97660aa7d38..147e6d4596f5f3c508cd076c369368a13fca5001 100644 --- a/tangostationcontrol/tangostationcontrol/devices/psoc.py +++ b/tangostationcontrol/tangostationcontrol/devices/psoc.py @@ -19,9 +19,9 @@ from tangostationcontrol.common.lofar_logging import ( device_logging_to_python, log_exceptions, ) +from tangostationcontrol.devices.base_device_classes.snmp_device import SNMPDevice from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.snmp_device import SNMPDevice from tangostationcontrol.clients.snmp.attribute_classes import PSOC_sim debug.setLogger(debug.Debug("searcher", "compiler", "borrower", "reader")) diff --git a/tangostationcontrol/tangostationcontrol/devices/recv/recvh.py b/tangostationcontrol/tangostationcontrol/devices/recv/recvh.py index 74826d4acda993e081d3f2c9475dcaaa746d2730..23b901a8aeed949a4031ff5bdda86dfdbfb4d096 100644 --- a/tangostationcontrol/tangostationcontrol/devices/recv/recvh.py +++ b/tangostationcontrol/tangostationcontrol/devices/recv/recvh.py @@ -21,7 +21,7 @@ from tangostationcontrol.common.constants import ( from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python -from tangostationcontrol.devices.interfaces.recv_device import RECVDevice +from tangostationcontrol.devices.base_device_classes.recv_device import RECVDevice __all__ = ["RECVH", "main"] diff --git a/tangostationcontrol/tangostationcontrol/devices/recv/recvl.py b/tangostationcontrol/tangostationcontrol/devices/recv/recvl.py index a1358712329f174b920d3e51c2d6b402193f5d1d..4f1e0f34b561df96d967d7776826f4979291b912 100644 --- a/tangostationcontrol/tangostationcontrol/devices/recv/recvl.py +++ b/tangostationcontrol/tangostationcontrol/devices/recv/recvl.py @@ -7,7 +7,7 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python -from tangostationcontrol.devices.interfaces.recv_device import RECVDevice +from tangostationcontrol.devices.base_device_classes.recv_device import RECVDevice __all__ = ["RECVL", "main"] diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py index 4bd3906a9f8f987472bd3904bd73448805615494..d6c4122599a96bcdc26e6d1347048307d4417a37 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/beamlet.py @@ -37,7 +37,7 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import log_exceptions from tangostationcontrol.common.proxy import create_device_proxy from tangostationcontrol.common.sdp import phases_to_weights -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice __all__ = ["Beamlet", "main"] diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py b/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py index a61544cdb960d69db2f48d53ada05825cde60624..a0882c92c3dc9fd76dd64a492c272c246f22be8e 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/digitalbeam.py @@ -24,7 +24,7 @@ from tangostationcontrol.common.constants import ( # Additional import from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import log_exceptions -from tangostationcontrol.devices.interfaces.beam_device import BeamDevice +from tangostationcontrol.devices.base_device_classes.beam_device import BeamDevice from tangostationcontrol.devices.types import DeviceTypes logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py b/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py index 2d86dbc55c11c46fd7dd5da020cdc2303c52709a..4783e0c0111ab2a589b6390c04af57d3f5b460ae 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/firmware.py @@ -17,7 +17,9 @@ from tango.server import device_property, attribute from tangostationcontrol.common.constants import N_pn from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice + +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice + from tangostationcontrol.devices.types import DeviceTypes logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py index 4bc60448b2c7c66f8dcbaa08c0ce4f3dd5e4af2a..6aacc0efa32dffd42209f85d7c4253bed07917dc 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/sdp.py @@ -29,7 +29,7 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.sdp import subband_frequencies from tangostationcontrol.devices.device_decorators import TimeIt -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice __all__ = ["SDP", "main"] diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py b/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py index 5f233c9a92606393174dd2187ba66a324cb32077..8a88fc949327c97c05a3efd5577f461f872c5cbd 100644 --- a/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py +++ b/tangostationcontrol/tangostationcontrol/devices/sdp/statistics.py @@ -16,7 +16,7 @@ from tango.server import device_property from tangostationcontrol.clients.statistics.client import StatisticsClient from tangostationcontrol.common.constants import MAX_ETH_FRAME_SIZE from tangostationcontrol.common.lofar_logging import log_exceptions -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/station_manager.py b/tangostationcontrol/tangostationcontrol/devices/station_manager.py index 0ebcc01c9bbf9f76cddf9a5b10e6bed4d559d6f3..a0845793b7f7cebd3e340ff0cd87042a37fb2f46 100644 --- a/tangostationcontrol/tangostationcontrol/devices/station_manager.py +++ b/tangostationcontrol/tangostationcontrol/devices/station_manager.py @@ -16,12 +16,15 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.lofar_logging import exception_to_str from tangostationcontrol.common.lofar_logging import log_exceptions +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.power_hierarchy import ( + PowerHierarchy, +) + from tangostationcontrol.common.states import ( StationState, ALLOWED_STATION_STATE_TRANSITIONS, ) -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice -from tangostationcontrol.devices.interfaces.power_hierarchy import PowerHierarchy logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py index 62de714a909f6dad62ff9d08da951ded8d4814d9..8ea38b1249026b5427fcabc82dada776595b97b8 100644 --- a/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py +++ b/tangostationcontrol/tangostationcontrol/devices/temperature_manager.py @@ -25,7 +25,7 @@ from tangostationcontrol.common.lofar_logging import ( log_exceptions, ) from tangostationcontrol.common.proxy import create_device_proxy -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/tilebeam.py b/tangostationcontrol/tangostationcontrol/devices/tilebeam.py index 937c77ba31f8d0249e0ba0efd0f89c93c67c4b15..3870aadbb581f16257a60d3167790915247eb8ea 100644 --- a/tangostationcontrol/tangostationcontrol/devices/tilebeam.py +++ b/tangostationcontrol/tangostationcontrol/devices/tilebeam.py @@ -16,7 +16,7 @@ from tangostationcontrol.common.lofar_logging import ( device_logging_to_python, log_exceptions, ) -from tangostationcontrol.devices.interfaces.beam_device import BeamDevice +from tangostationcontrol.devices.base_device_classes.beam_device import BeamDevice logger = logging.getLogger() diff --git a/tangostationcontrol/tangostationcontrol/devices/unb2.py b/tangostationcontrol/tangostationcontrol/devices/unb2.py index 44ef128b278bf0336b7d82631e4f756250a49521..b737cd60db3c20eb4c9b1d957d9ac053f1ce7704 100644 --- a/tangostationcontrol/tangostationcontrol/devices/unb2.py +++ b/tangostationcontrol/tangostationcontrol/devices/unb2.py @@ -22,7 +22,7 @@ from tangostationcontrol.common.entrypoint import entry from tangostationcontrol.common.lofar_logging import device_logging_to_python from tangostationcontrol.common.states import DEFAULT_COMMAND_STATES from tangostationcontrol.devices.device_decorators import only_in_states -from tangostationcontrol.devices.interfaces.opcua_device import OPCUADevice +from tangostationcontrol.devices.base_device_classes.opcua_device import OPCUADevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/examples/HW_device_template.py b/tangostationcontrol/tangostationcontrol/examples/HW_device_template.py index b45f0634dfc69f4196f70b62902ab30bdae2b81b..54aa041231efca398cf60f381b382b42bed71ddb 100644 --- a/tangostationcontrol/tangostationcontrol/examples/HW_device_template.py +++ b/tangostationcontrol/tangostationcontrol/examples/HW_device_template.py @@ -5,7 +5,7 @@ import logging # PyTango imports from tango.server import run -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice # Additional import diff --git a/tangostationcontrol/tangostationcontrol/examples/load_from_disk/ini_device.py b/tangostationcontrol/tangostationcontrol/examples/load_from_disk/ini_device.py index 83abed6a33ba93cae1a1f2ddb94d52f6d25c46e9..ed767929bc308c8ad3f122f7a4c45e80a912c8be 100644 --- a/tangostationcontrol/tangostationcontrol/examples/load_from_disk/ini_device.py +++ b/tangostationcontrol/tangostationcontrol/examples/load_from_disk/ini_device.py @@ -12,7 +12,7 @@ from tango import AttrWriteType from tango.server import run # Additional import -from tangostationcontrol.devices.interfaces.lofar_device import LOFARDevice +from tangostationcontrol.devices.base_device_classes.lofar_device import LOFARDevice from tangostationcontrol.examples.load_from_disk.ini_client import IniClient logger = logging.getLogger() diff --git a/tangostationcontrol/test/devices/base_device_classes/__init__.py b/tangostationcontrol/test/devices/base_device_classes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..68ddd5cdc3efaa38e853aef337c08beb99c50c4c --- /dev/null +++ b/tangostationcontrol/test/devices/base_device_classes/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy) +# SPDX-License-Identifier: Apache-2.0 diff --git a/tangostationcontrol/test/devices/interfaces/test_async_device.py b/tangostationcontrol/test/devices/base_device_classes/test_async_device.py similarity index 92% rename from tangostationcontrol/test/devices/interfaces/test_async_device.py rename to tangostationcontrol/test/devices/base_device_classes/test_async_device.py index 52b846104cf51e0473c0674995c3f339139c7ea5..a22f395b35a571cb4ad87ed909dc1a7276ab546b 100644 --- a/tangostationcontrol/test/devices/interfaces/test_async_device.py +++ b/tangostationcontrol/test/devices/base_device_classes/test_async_device.py @@ -7,9 +7,9 @@ from tango.server import device_property from tango.test_context import DeviceTestContext -from tangostationcontrol.devices.interfaces import async_device +from tangostationcontrol.devices.base_device_classes import async_device -from test.devices.interfaces.test_lofar_device import TestLofarDevice +from test.devices.base_device_classes.test_lofar_device import TestLofarDevice class TestAsyncDevice(TestLofarDevice): diff --git a/tangostationcontrol/test/devices/interfaces/test_beam_device.py b/tangostationcontrol/test/devices/base_device_classes/test_beam_device.py similarity index 99% rename from tangostationcontrol/test/devices/interfaces/test_beam_device.py rename to tangostationcontrol/test/devices/base_device_classes/test_beam_device.py index 03f551a63c77cfda80a672d00f52bcc157b0e7d3..331afcad8d984b341adad217f02c79642da8de57 100644 --- a/tangostationcontrol/test/devices/interfaces/test_beam_device.py +++ b/tangostationcontrol/test/devices/base_device_classes/test_beam_device.py @@ -12,7 +12,7 @@ import numpy as np import timeout_decorator from tango import DevFailed -from tangostationcontrol.devices.interfaces import beam_device +from tangostationcontrol.devices.base_device_classes import beam_device from unittest import mock from test import base diff --git a/tangostationcontrol/test/devices/interfaces/test_hierarchy.py b/tangostationcontrol/test/devices/base_device_classes/test_hierarchy.py similarity index 99% rename from tangostationcontrol/test/devices/interfaces/test_hierarchy.py rename to tangostationcontrol/test/devices/base_device_classes/test_hierarchy.py index 68f3ee04070f54798bcc13a25ebf92abe50bdd1b..ce120eec60cc5eab3e8debda8aafad7e6d34d2f4 100644 --- a/tangostationcontrol/test/devices/interfaces/test_hierarchy.py +++ b/tangostationcontrol/test/devices/base_device_classes/test_hierarchy.py @@ -10,7 +10,7 @@ from unittest.mock import Mock, patch from tango import DevState, DeviceProxy -from tangostationcontrol.devices.interfaces import hierarchy +from tangostationcontrol.devices.base_device_classes import hierarchy from test.devices import device_base diff --git a/tangostationcontrol/test/devices/interfaces/test_hierarchy_device.py b/tangostationcontrol/test/devices/base_device_classes/test_hierarchy_device.py similarity index 89% rename from tangostationcontrol/test/devices/interfaces/test_hierarchy_device.py rename to tangostationcontrol/test/devices/base_device_classes/test_hierarchy_device.py index 95228d780eada798e30402f78576961eb33c30c3..f32de04f7a931177f63401ec37199c57db13fe85 100644 --- a/tangostationcontrol/test/devices/interfaces/test_hierarchy_device.py +++ b/tangostationcontrol/test/devices/base_device_classes/test_hierarchy_device.py @@ -7,9 +7,9 @@ from tango.server import command from tango.server import device_property from tango.test_context import DeviceTestContext -from tangostationcontrol.devices.interfaces import hierarchy -from tangostationcontrol.devices.interfaces import hierarchy_device -from tangostationcontrol.devices.interfaces import lofar_device +from tangostationcontrol.devices.base_device_classes import hierarchy +from tangostationcontrol.devices.base_device_classes import hierarchy_device +from tangostationcontrol.devices.base_device_classes import lofar_device from test.devices import device_base diff --git a/tangostationcontrol/test/devices/interfaces/test_lofar_device.py b/tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py similarity index 98% rename from tangostationcontrol/test/devices/interfaces/test_lofar_device.py rename to tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py index 1c5b21d2d9eb43d1e68134619d86064467ea95db..016d9631b0392a2cdeb1aa6b0cd95ce04ce4bfc4 100644 --- a/tangostationcontrol/test/devices/interfaces/test_lofar_device.py +++ b/tangostationcontrol/test/devices/base_device_classes/test_lofar_device.py @@ -12,7 +12,7 @@ from tango.server import attribute from tango.server import command from tango.test_context import DeviceTestContext -from tangostationcontrol.devices.interfaces import lofar_device +from tangostationcontrol.devices.base_device_classes import lofar_device from test.devices import device_base diff --git a/tangostationcontrol/test/devices/device_base.py b/tangostationcontrol/test/devices/device_base.py index 7f51e8d52c3826c5d5a3875cddd86100f7102cfd..122679624a656a076d5ad0794d8f0ac1eafb9f3e 100644 --- a/tangostationcontrol/test/devices/device_base.py +++ b/tangostationcontrol/test/devices/device_base.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 from tangostationcontrol.common import proxy -from tangostationcontrol.devices.interfaces import hierarchy_device +from tangostationcontrol.devices.base_device_classes import hierarchy_device from test import base diff --git a/tangostationcontrol/test/devices/interfaces/__init__.py b/tangostationcontrol/test/devices/interfaces/__init__.py deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000