From 79dcec4ed6a555dc91329b6a730b0180faaaf95e Mon Sep 17 00:00:00 2001
From: lukken <lukken@astron.nl>
Date: Tue, 9 Aug 2022 15:33:09 +0000
Subject: [PATCH] L2SS-868: Correct imports for migration to LSC

---
 .../tangostationcontrol/devices/sdp/bst.py             |  7 ++++---
 .../tangostationcontrol/devices/sdp/xst.py             |  3 ++-
 .../statistics_writer/hdf5_writer.py                   | 10 ++++++----
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py
index 09622f1f6..1ec2a46f1 100644
--- a/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py
+++ b/tangostationcontrol/tangostationcontrol/devices/sdp/bst.py
@@ -11,18 +11,19 @@
 
 """
 
+import numpy
+
 from tango.server import device_property, attribute
 from tango import AttrWriteType
 
+from lofar_station_client.statistics.collector import BSTCollector
+
 # Own imports
 from tangostationcontrol.common.entrypoint import entry
 from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
 from tangostationcontrol.clients.opcua_client import OPCUAConnection
 from tangostationcontrol.clients.statistics.client import StatisticsClient
 from tangostationcontrol.devices.sdp.statistics import Statistics
-from tangostationcontrol.statistics.collector import BSTCollector
-
-import numpy
 
 __all__ = ["BST", "main"]
 
diff --git a/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py b/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py
index 5d13c08ea..dec4acfb4 100644
--- a/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py
+++ b/tangostationcontrol/tangostationcontrol/devices/sdp/xst.py
@@ -15,6 +15,8 @@
 from tango.server import device_property, attribute
 from tango import AttrWriteType
 
+from lofar_station_client.statistics.collector import XSTCollector
+
 # Additional import
 from tangostationcontrol.common.entrypoint import entry
 from tangostationcontrol.clients.attribute_wrapper import attribute_wrapper
@@ -22,7 +24,6 @@ from tangostationcontrol.clients.opcua_client import OPCUAConnection
 from tangostationcontrol.clients.statistics.client import StatisticsClient
 
 from tangostationcontrol.devices.sdp.statistics import Statistics
-from tangostationcontrol.statistics.statistics_collector import XSTCollector
 
 import numpy
 
diff --git a/tangostationcontrol/tangostationcontrol/statistics_writer/hdf5_writer.py b/tangostationcontrol/tangostationcontrol/statistics_writer/hdf5_writer.py
index 1385ccd13..846621208 100644
--- a/tangostationcontrol/tangostationcontrol/statistics_writer/hdf5_writer.py
+++ b/tangostationcontrol/tangostationcontrol/statistics_writer/hdf5_writer.py
@@ -16,7 +16,9 @@ import h5py
 import numpy
 import pytz
 
-import lofar_station_client.statistics.collector as statistics_collector
+from lofar_station_client.statistics.collector import BSTCollector
+from lofar_station_client.statistics.collector import XSTCollector
+from tangostationcontrol.statistics.collector import StationSSTCollector
 
 from lofar_station_client.statistics.packet import SSTPacket, XSTPacket, BSTPacket
 
@@ -234,7 +236,7 @@ class sst_hdf5_writer(hdf5_writer):
         return SSTPacket(packet)
 
     def new_collector(self):
-        return statistics_collector.StationSSTCollector()
+        return StationSSTCollector()
 
     def write_values_matrix(self, current_group):
         # store the SST values
@@ -256,7 +258,7 @@ class bst_hdf5_writer(hdf5_writer):
         return BSTPacket(packet)
 
     def new_collector(self):
-        return statistics_collector.BSTCollector()
+        return BSTCollector()
 
     def write_values_matrix(self, current_group):
         # store the BST values
@@ -272,7 +274,7 @@ class xst_hdf5_writer(hdf5_writer):
         return XSTPacket(packet)
 
     def new_collector(self):
-        return statistics_collector.XSTCollector()
+        return XSTCollector()
 
     def next_filename(self, timestamp):
         time_str = str(timestamp.strftime("%Y-%m-%d-%H-%M-%S"))
-- 
GitLab