From 2e46bfeb5bbac6cefa155b556cee22e51f398095 Mon Sep 17 00:00:00 2001 From: samartse Date: Mon, 11 Sep 2023 16:59:09 +0200 Subject: [PATCH 1/8] renamed modules to initial namings --- pymepix/{api => channel}/__init__.py | 0 .../{api/data_types.py => channel/channel_types.py} | 2 +- pymepix/{api => channel}/client.py | 0 pymepix/{api => channel}/data_channel.py | 10 +++++----- pymepix/pymepix_connection.py | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) rename pymepix/{api => channel}/__init__.py (100%) rename pymepix/{api/data_types.py => channel/channel_types.py} (87%) rename pymepix/{api => channel}/client.py (100%) rename pymepix/{api => channel}/data_channel.py (83%) diff --git a/pymepix/api/__init__.py b/pymepix/channel/__init__.py similarity index 100% rename from pymepix/api/__init__.py rename to pymepix/channel/__init__.py diff --git a/pymepix/api/data_types.py b/pymepix/channel/channel_types.py similarity index 87% rename from pymepix/api/data_types.py rename to pymepix/channel/channel_types.py index 3dc64dc..4bc7077 100644 --- a/pymepix/api/data_types.py +++ b/pymepix/channel/channel_types.py @@ -1,7 +1,7 @@ from enum import Enum -class ApiDataType(Enum): +class ChannelDataType(Enum): COMMAND = 'comm' PIXEL = 'pixel' TOF = 'tof' diff --git a/pymepix/api/client.py b/pymepix/channel/client.py similarity index 100% rename from pymepix/api/client.py rename to pymepix/channel/client.py diff --git a/pymepix/api/data_channel.py b/pymepix/channel/data_channel.py similarity index 83% rename from pymepix/api/data_channel.py rename to pymepix/channel/data_channel.py index 3091e68..06fe713 100644 --- a/pymepix/api/data_channel.py +++ b/pymepix/channel/data_channel.py @@ -2,7 +2,7 @@ import zmq import queue -from pymepix.api.data_types import ApiDataType +from pymepix.channel.channel_types import ChannelDataType from pymepix.processing.datatypes import MessageType @@ -51,15 +51,15 @@ def run(self): self.socket.send_pyobj(new_data) def send(self, data_type, data): - if data_type == ApiDataType.COMMAND: + if data_type == ChannelDataType.COMMAND: self.q.put_nowait({'type': data_type.value, 'data': data.value}) else: self.q.put_nowait({'type': data_type.value, 'data': data}) def send_data_by_message_type(self, message_type, data): if message_type == MessageType.PixelData: - self.q.put_nowait({'type': ApiDataType.PIXEL.value, 'data': data}) + self.q.put_nowait({'type': ChannelDataType.PIXEL.value, 'data': data}) elif message_type == MessageType.EventData: - self.q.put_nowait({'type': ApiDataType.TOF.value, 'data': data}) + self.q.put_nowait({'type': ChannelDataType.TOF.value, 'data': data}) elif message_type == MessageType.CentroidData: - self.q.put_nowait({'type': ApiDataType.CENTROID.value, 'data': data}) + self.q.put_nowait({'type': ChannelDataType.CENTROID.value, 'data': data}) diff --git a/pymepix/pymepix_connection.py b/pymepix/pymepix_connection.py index 0b32463..0dd31c6 100644 --- a/pymepix/pymepix_connection.py +++ b/pymepix/pymepix_connection.py @@ -28,8 +28,8 @@ from .SPIDR.spidrcontroller import SPIDRController from .TPX4.tpx4controller import Timepix4Controller from .timepixdevice import TimepixDevice -from pymepix.api.data_types import Commands, ApiDataType -from pymepix.api.data_channel import Data_Channel +from pymepix.channel.channel_types import Commands, ChannelDataType +from pymepix.channel.data_channel import Data_Channel from .timepix4device import Timepix4Device @@ -230,11 +230,11 @@ def start_recording(self, path): self._timepix_devices[0].start_recording(path) - self._channel.send(ApiDataType.COMMAND, Commands.START_RECORD) + self._channel.send(ChannelDataType.COMMAND, Commands.START_RECORD) def stop_recording(self): self._timepix_devices[0].stop_recording() - self._channel.send(ApiDataType.COMMAND, Commands.STOP_RECORD) + self._channel.send(ChannelDataType.COMMAND, Commands.STOP_RECORD) def start(self): """Starts acquisition""" From f6c39f3e88d6bad7492ff7d2f38888de65a7ef7d Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Tue, 5 Dec 2023 16:03:07 +0100 Subject: [PATCH 2/8] remove walrus operator, not compatible with python7, used at hulk --- pymepix/processing/rawtodisk.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymepix/processing/rawtodisk.py b/pymepix/processing/rawtodisk.py index 9fd279f..200815a 100644 --- a/pymepix/processing/rawtodisk.py +++ b/pymepix/processing/rawtodisk.py @@ -82,7 +82,9 @@ def _run_filewriter_thr(self, sock_addr, context=None): self.info(f"zmq connect to tcp://127.0.0.1:{cfg.default_cfg['zmq_port']}") # socket to maxwell - if remote_server := cfg.default_cfg.get('remote_processing_host') is not None: + remote_server = cfg.default_cfg.get('remote_processing_host') + + if remote_server is not None: self.info(f'connecting to processing server {remote_server}') max_sock = context.socket(zmq.PUSH) max_sock.connect(f"tcp://{remote_server}") From d5bfb4cc4668ac7f652776b40a0baa7630fe34b9 Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Wed, 6 Dec 2023 14:56:31 +0100 Subject: [PATCH 3/8] improved ip addressing, some fixes --- pymepix/SPIDR/spidrcontroller.py | 9 +++++---- pymepix/TPX4/tpx4chipdevice.py | 9 ++++----- pymepix/TPX4/tpx4controller.py | 7 ++++--- pymepix/config/default.yaml | 9 ++++----- pymepix/pymepix_connection.py | 12 +++++------- 5 files changed, 22 insertions(+), 24 deletions(-) diff --git a/pymepix/SPIDR/spidrcontroller.py b/pymepix/SPIDR/spidrcontroller.py index a5bbf05..48f6d7b 100644 --- a/pymepix/SPIDR/spidrcontroller.py +++ b/pymepix/SPIDR/spidrcontroller.py @@ -73,13 +73,14 @@ class SPIDRController(Logger): """ - def __init__(self, dst_ip_port, src_ip_port): + def __init__(self, dst_ip_port, pc_ip, udp_port): Logger.__init__(self, SPIDRController.__name__) self.info("Connecting to camera on {}:{}".format(*dst_ip_port)) - self._src_ip_port = src_ip_port + self._pc_ip = pc_ip + self._udp_port = udp_port # TCP connection - self._sock = socket.create_connection(dst_ip_port, source_address=(src_ip_port[0], 0)) + self._sock = socket.create_connection(dst_ip_port, source_address=(pc_ip, 0)) self._request_lock = threading.Lock() self._req_buffer = np.ndarray(shape=(512,), dtype=np.uint32) self._reply_buffer = bytearray(4096) @@ -105,7 +106,7 @@ def _initDevices(self): for x in range(count): self._devices.append(SpidrDevice(self, x)) - self._devices[x].serverPort = self._src_ip_port[1] + x + self._devices[x].serverPort = self._udp_port + x def prepare(self): self.disableExternalRefClock() diff --git a/pymepix/TPX4/tpx4chipdevice.py b/pymepix/TPX4/tpx4chipdevice.py index d928750..ba72606 100644 --- a/pymepix/TPX4/tpx4chipdevice.py +++ b/pymepix/TPX4/tpx4chipdevice.py @@ -3,8 +3,6 @@ import weakref -import numpy as np - from pymepix.core.log import Logger class Tpx4ChipDevice(Logger): @@ -16,6 +14,8 @@ def __init__(self, _ctrl, device_num): self.info("Device {} with device number {} created".format(self._dev_num, self._dev_num)) + self._serverPort = None + @property def linkStatus(self): @@ -50,12 +50,11 @@ def ipAddrDest(self, ipaddr): @property def serverPort(self): # NEEDS IMPLEMENTATION - return 50000 + return self._serverPort @serverPort.setter def serverPort(self, value): - # NEEDS IMPLEMENTATION - pass + self._serverPort = value @property diff --git a/pymepix/TPX4/tpx4controller.py b/pymepix/TPX4/tpx4controller.py index 7d74c11..b6b0b4b 100644 --- a/pymepix/TPX4/tpx4controller.py +++ b/pymepix/TPX4/tpx4controller.py @@ -9,10 +9,11 @@ class Timepix4Controller(Logger): - def __init__(self, dst_ip_port, src_ip_port): + def __init__(self, dst_ip_port, pc_ip, udp_port): Logger.__init__(self, Timepix4Controller.__name__) - self._src_ip_port = src_ip_port + self._pc_ip = pc_ip + self._udp_port = udp_port self._devices = [] self._initDevices() @@ -31,7 +32,7 @@ def _initDevices(self): for x in range(count): self._devices.append(Tpx4ChipDevice(self, x)) - self._devices[x].serverPort = self._src_ip_port[1] + x + self._devices[x].serverPort = self._udp_port + x diff --git a/pymepix/config/default.yaml b/pymepix/config/default.yaml index 7ec3e90..597faed 100644 --- a/pymepix/config/default.yaml +++ b/pymepix/config/default.yaml @@ -1,15 +1,14 @@ timepix: pc_ip : '192.168.1.1' - tpx_ip : '192.168.1.10' + tpx_ip : '192.168.1.11' + tpx_port: 50000 + udp_port: 8192 sophy_config : 'path_to_sophy_config' remote_processing_host: '131.169.168.130:13049' camera_generation: 3 trainID: connected: False device : '/dev/ttyUSB0' -src_ip_port: - - '192.168.1.1' - - 8192 api_channel: ip: '127.0.0.1' - port: 5056 \ No newline at end of file + port: 5056 diff --git a/pymepix/pymepix_connection.py b/pymepix/pymepix_connection.py index 0dd31c6..2083fa5 100644 --- a/pymepix/pymepix_connection.py +++ b/pymepix/pymepix_connection.py @@ -76,8 +76,6 @@ class PymepixConnection(Logger): >>> timepix[0].loadSophyConfig('W0026_K06_50V.spx') - - """ def data_thread(self): @@ -94,9 +92,10 @@ def data_thread(self): self._channel.send_data_by_message_type(data_type, data) def __init__(self, - spidr_address=(cfg.default_cfg["timepix"]["tpx_ip"], 50000), - src_ip_port=(cfg.default_cfg['timepix']['pc_ip'], - int(cfg.default_cfg.get('timepix').get('pc_port', 8192))), + spidr_address=(cfg.default_cfg['timepix']['tpx_ip'], + int(cfg.default_cfg.get('timepix').get('tpx_port', 50000))), + udp_port=int(cfg.default_cfg.get('timepix').get('udp_port', 8192)), + pc_ip = cfg.default_cfg['timepix']['pc_ip'], api_address=(cfg.default_cfg['api_channel']['ip'], cfg.default_cfg['api_channel']['port']), @@ -107,14 +106,13 @@ def __init__(self, self._channel = Data_Channel() self._channel.start() - #self._channel_address = tuple(cfg.default_cfg.get('tcp_channel', ['127.0.0.1', 5056])) self._channel.register(f'tcp://{api_address[0]}:{api_address[1]}') self.camera_generation = camera_generation controllerClass = self.timepix_controller_class_factory(camera_generation) - self._controller = controllerClass(spidr_address, src_ip_port) + self._controller = controllerClass(spidr_address, pc_ip, udp_port) TimepixDeviceClass = self.timepix_device_class_factory(camera_generation) self._timepix_devices: list[TimepixDeviceClass] = [] From 2e09decb50ec13012a184303c78a51ade1cdfec6 Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Wed, 6 Dec 2023 17:53:47 +0100 Subject: [PATCH 4/8] added udp ip address for image data, could used at timpepix4 camera --- pymepix/SPIDR/spidrcontroller.py | 6 +++--- pymepix/TPX4/tpx4chipdevice.py | 16 ++++------------ pymepix/TPX4/tpx4controller.py | 8 +++++--- pymepix/config/default.yaml | 1 + pymepix/pymepix_connection.py | 4 ++-- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/pymepix/SPIDR/spidrcontroller.py b/pymepix/SPIDR/spidrcontroller.py index 48f6d7b..1f83193 100644 --- a/pymepix/SPIDR/spidrcontroller.py +++ b/pymepix/SPIDR/spidrcontroller.py @@ -73,12 +73,12 @@ class SPIDRController(Logger): """ - def __init__(self, dst_ip_port, pc_ip, udp_port): + def __init__(self, dst_ip_port, pc_ip, udp_ip_port): Logger.__init__(self, SPIDRController.__name__) self.info("Connecting to camera on {}:{}".format(*dst_ip_port)) self._pc_ip = pc_ip - self._udp_port = udp_port + self._udp_ip_port = udp_ip_port # TCP connection self._sock = socket.create_connection(dst_ip_port, source_address=(pc_ip, 0)) self._request_lock = threading.Lock() @@ -106,7 +106,7 @@ def _initDevices(self): for x in range(count): self._devices.append(SpidrDevice(self, x)) - self._devices[x].serverPort = self._udp_port + x + self._devices[x].serverPort = self._udp_ip_port[1] + x def prepare(self): self.disableExternalRefClock() diff --git a/pymepix/TPX4/tpx4chipdevice.py b/pymepix/TPX4/tpx4chipdevice.py index ba72606..16621ee 100644 --- a/pymepix/TPX4/tpx4chipdevice.py +++ b/pymepix/TPX4/tpx4chipdevice.py @@ -14,42 +14,34 @@ def __init__(self, _ctrl, device_num): self.info("Device {} with device number {} created".format(self._dev_num, self._dev_num)) + self._ipAddrDest = None self._serverPort = None @property def linkStatus(self): # NEEDS IMPLEMENTATION - return True, True, True @property def ipAddrSrc(self): # NEEDS IMPLEMENTATION - return "{}.{}.{}.{}".format(127,0,0,1) @ipAddrSrc.setter def ipAddrSrc(self, ipaddr): - # NEEDS IMPLEMENTATION - pass - - + self._ipAddrDest = ipaddr @property def ipAddrDest(self): - # NEEDS IMPLEMENTATION - - return "{}.{}.{}.{}".format(127,0,0,1) + return self._ipAddrDest @ipAddrDest.setter def ipAddrDest(self, ipaddr): - # NEEDS IMPLEMENTATION - pass + self._ipAddrDest = ipaddr @property def serverPort(self): - # NEEDS IMPLEMENTATION return self._serverPort @serverPort.setter diff --git a/pymepix/TPX4/tpx4controller.py b/pymepix/TPX4/tpx4controller.py index b6b0b4b..265e12a 100644 --- a/pymepix/TPX4/tpx4controller.py +++ b/pymepix/TPX4/tpx4controller.py @@ -9,11 +9,12 @@ class Timepix4Controller(Logger): - def __init__(self, dst_ip_port, pc_ip, udp_port): + def __init__(self, dst_ip_port, pc_ip, udp_ip_port): Logger.__init__(self, Timepix4Controller.__name__) + self._spidrAddr = dst_ip_port self._pc_ip = pc_ip - self._udp_port = udp_port + self._udp_ip_port = udp_ip_port self._devices = [] self._initDevices() @@ -32,7 +33,8 @@ def _initDevices(self): for x in range(count): self._devices.append(Tpx4ChipDevice(self, x)) - self._devices[x].serverPort = self._udp_port + x + self._devices[x].ipAddrDest = self._udp_ip_port[0] + self._devices[x].serverPort = self._udp_ip_port[1] + x diff --git a/pymepix/config/default.yaml b/pymepix/config/default.yaml index 597faed..8397d92 100644 --- a/pymepix/config/default.yaml +++ b/pymepix/config/default.yaml @@ -2,6 +2,7 @@ timepix: pc_ip : '192.168.1.1' tpx_ip : '192.168.1.11' tpx_port: 50000 + udp_ip: '192.168.1.11' udp_port: 8192 sophy_config : 'path_to_sophy_config' remote_processing_host: '131.169.168.130:13049' diff --git a/pymepix/pymepix_connection.py b/pymepix/pymepix_connection.py index 2083fa5..aacf184 100644 --- a/pymepix/pymepix_connection.py +++ b/pymepix/pymepix_connection.py @@ -94,7 +94,7 @@ def data_thread(self): def __init__(self, spidr_address=(cfg.default_cfg['timepix']['tpx_ip'], int(cfg.default_cfg.get('timepix').get('tpx_port', 50000))), - udp_port=int(cfg.default_cfg.get('timepix').get('udp_port', 8192)), + udp_ip_port=(cfg.default_cfg['timepix']['udp_ip'], cfg.default_cfg['timepix']['udp_port']), pc_ip = cfg.default_cfg['timepix']['pc_ip'], api_address=(cfg.default_cfg['api_channel']['ip'], cfg.default_cfg['api_channel']['port']), @@ -112,7 +112,7 @@ def __init__(self, controllerClass = self.timepix_controller_class_factory(camera_generation) - self._controller = controllerClass(spidr_address, pc_ip, udp_port) + self._controller = controllerClass(spidr_address, pc_ip, udp_ip_port) TimepixDeviceClass = self.timepix_device_class_factory(camera_generation) self._timepix_devices: list[TimepixDeviceClass] = [] From d30362442a9a20ac424bc9ff70f2a6809b54e905 Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Thu, 7 Dec 2023 17:38:01 +0100 Subject: [PATCH 5/8] updated configuration files --- pymepix/config/default.yaml | 5 ++++- pymepix/config/ecomo_10Gb.yaml | 16 ++++++++++------ pymepix/config/ecomo_el.yaml | 16 ++++++++++------ pymepix/config/ecomo_ion.yaml | 12 ++++++++---- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/pymepix/config/default.yaml b/pymepix/config/default.yaml index 8397d92..6d3cf0f 100644 --- a/pymepix/config/default.yaml +++ b/pymepix/config/default.yaml @@ -1,3 +1,4 @@ +name: 'ions' timepix: pc_ip : '192.168.1.1' tpx_ip : '192.168.1.11' @@ -5,11 +6,13 @@ timepix: udp_ip: '192.168.1.11' udp_port: 8192 sophy_config : 'path_to_sophy_config' - remote_processing_host: '131.169.168.130:13049' camera_generation: 3 trainID: connected: False device : '/dev/ttyUSB0' +tango_api: + port: 9994 api_channel: ip: '127.0.0.1' port: 5056 + diff --git a/pymepix/config/ecomo_10Gb.yaml b/pymepix/config/ecomo_10Gb.yaml index 48dfaa1..f7bacd8 100644 --- a/pymepix/config/ecomo_10Gb.yaml +++ b/pymepix/config/ecomo_10Gb.yaml @@ -1,14 +1,18 @@ name: 'ions' timepix: - pc_ip : '192.168.100.1' - udp_port: 11113 - tpx_ip : '192.168.100.10' + pc_ip : '192.168.1.1' + tpx_ip : '192.168.1.11' + tpx_port: 50000 + udp_ip: '192.168.1.11' + udp_port: 8192 sophy_config : '/home/cfelcmi/timepix/10Gb2_50V_IKrum150.spx' + camera_generation: 3 trainID: connected: False device : '/dev/ttyUSB0' tango_api: port: 9994 -tcpchannel: - ip : '127.0.0.1' - port: 5056 \ No newline at end of file +api_channel: + ip: '127.0.0.1' + port: 5056 + diff --git a/pymepix/config/ecomo_el.yaml b/pymepix/config/ecomo_el.yaml index a2009f9..9628bce 100644 --- a/pymepix/config/ecomo_el.yaml +++ b/pymepix/config/ecomo_el.yaml @@ -1,14 +1,18 @@ -name: 'electrons' +name: 'ions' timepix: pc_ip : '192.168.1.1' - pc_port: 5566 - tpx_ip : '192.168.1.10' + tpx_ip : '192.168.1.11' + tpx_port: 50000 + udp_ip: '192.168.1.11' + udp_port: 8192 sophy_config : '/home/cfelcmi/timepix/ElectronTPX_IKrum150.spx' + camera_generation: 3 trainID: connected: False device : '/dev/ttyUSB0' tango_api: - port: 9993 -tcpchannel: - ip : '127.0.0.1' + port: 9994 +api_channel: + ip: '127.0.0.1' port: 5056 + diff --git a/pymepix/config/ecomo_ion.yaml b/pymepix/config/ecomo_ion.yaml index 2e6adaf..f7bacd8 100644 --- a/pymepix/config/ecomo_ion.yaml +++ b/pymepix/config/ecomo_ion.yaml @@ -1,14 +1,18 @@ name: 'ions' timepix: pc_ip : '192.168.1.1' - udp_port: 11113 tpx_ip : '192.168.1.11' + tpx_port: 50000 + udp_ip: '192.168.1.11' + udp_port: 8192 sophy_config : '/home/cfelcmi/timepix/10Gb2_50V_IKrum150.spx' + camera_generation: 3 trainID: connected: False device : '/dev/ttyUSB0' tango_api: port: 9994 -tcpchannel: - ip : '127.0.0.1' - port: 5056 \ No newline at end of file +api_channel: + ip: '127.0.0.1' + port: 5056 + From bdee039ba8c050745c2a520823e97ddf2c15f228 Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Wed, 20 Dec 2023 15:30:51 +0100 Subject: [PATCH 6/8] minor corrections --- pymepix/processing/baseacquisition.py | 3 +-- pymepix/processing/pipeline_centroid_calculator.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pymepix/processing/baseacquisition.py b/pymepix/processing/baseacquisition.py index 64c2c14..8ae15aa 100644 --- a/pymepix/processing/baseacquisition.py +++ b/pymepix/processing/baseacquisition.py @@ -42,7 +42,6 @@ class AcquisitionStage(Logger): ------------ stage: int Initial position in the pipeline, lower stages are executed first - """ def __init__(self, stage, num_processes=1): @@ -142,7 +141,7 @@ def build(self, input_queue=None, output_queue=None, file_writer=None): self.debug("I am creating the queue") self._output_queue = Queue() else: - self.debug("Recieved the queue {}".format(output_queue)) + self.debug("Received the queue {}".format(output_queue)) self.debug("Building stage {} ".format(self._stage_number)) self.info("Creating {} processes".format(self._num_processes)) for n in range(self._num_processes): diff --git a/pymepix/processing/pipeline_centroid_calculator.py b/pymepix/processing/pipeline_centroid_calculator.py index cb401d9..da476d3 100644 --- a/pymepix/processing/pipeline_centroid_calculator.py +++ b/pymepix/processing/pipeline_centroid_calculator.py @@ -27,7 +27,7 @@ class PipelineCentroidCalculator(BasePipelineObject): - """Performs centroiding on EventData recieved from Packet processor""" + """Performs centroiding on EventData received from Packet processor""" def __init__( self, From 814d4273ceb4fba609aede3f1158ccdb42249a96 Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Fri, 22 Dec 2023 13:46:41 +0100 Subject: [PATCH 7/8] unset n_jobs in centroiding, no Parallel multiprocessing in pipeline processes --- pymepix/processing/logic/centroid_calculator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymepix/processing/logic/centroid_calculator.py b/pymepix/processing/logic/centroid_calculator.py index 8f21035..c8f1bdb 100644 --- a/pymepix/processing/logic/centroid_calculator.py +++ b/pymepix/processing/logic/centroid_calculator.py @@ -388,7 +388,8 @@ def perform_centroiding_dbscan(self, chunks): # return p.map(self.calculate_centroids_dbscan, chunks) if self.number_of_processes>1: - return Parallel(n_jobs=self.number_of_processes)(delayed(calculate_centroids_dbscan)(c,self.tot_threshold, self._tof_scale, self.epsilon, self.min_samples, self._cent_timewalk_lut) for c in chunks) +# return Parallel(n_jobs=self.number_of_processes)(delayed(calculate_centroids_dbscan)(c,self.tot_threshold, self._tof_scale, self.epsilon, self.min_samples, self._cent_timewalk_lut) for c in chunks) + return Parallel(n_jobs=None)(delayed(calculate_centroids_dbscan)(c,self.tot_threshold, self._tof_scale, self.epsilon, self.min_samples, self._cent_timewalk_lut) for c in chunks) return map(self.calculate_centroids_dbscan, chunks) From 1a95e446b866b032a653fe02d50dfefccbc59bee Mon Sep 17 00:00:00 2001 From: Andrey Samartsev Date: Fri, 5 Jan 2024 17:26:07 +0100 Subject: [PATCH 8/8] minor bugfixes and corrections --- pymepix/processing/baseacquisition.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymepix/processing/baseacquisition.py b/pymepix/processing/baseacquisition.py index 8ae15aa..6372b7c 100644 --- a/pymepix/processing/baseacquisition.py +++ b/pymepix/processing/baseacquisition.py @@ -32,7 +32,7 @@ class AcquisitionStage(Logger): """Defines a single acquisition stage - Usually not created directly. Instead created by :class:`AcquisitionPipeline` + Usually not created directly. Instead, it is created by :class:`AcquisitionPipeline` Represent a single pipeline stage and handles management of queues and message passing as well as creation and destruction of processing objects. @@ -129,7 +129,7 @@ def setArgs(self, *args, **kwargs): def processes(self): return self._pipeline_objects - def build(self, input_queue=None, output_queue=None, file_writer=None): + def build(self, input_queue=None, output_queue=None): self._input_queue = input_queue self._output_queue = output_queue @@ -154,8 +154,8 @@ def build(self, input_queue=None, output_queue=None, file_writer=None): ) p.daemon = True self._pipeline_objects.append(p) - if self._output_queue is None: - self._output_queue = p.outputQueues()[-1] +# if self._output_queue is None: do we really need it? +# self._output_queue = p.outputQueues()[-1] @property def outputQueue(self):