From e5fc7b27501c98514156a5551fdc9a512e26f092 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 2 Aug 2024 13:53:25 +0200 Subject: [PATCH] cleanup --- dap/worker.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dap/worker.py b/dap/worker.py index 09bf17c..7e0b8bc 100644 --- a/dap/worker.py +++ b/dap/worker.py @@ -90,15 +90,18 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host except Exception as e: print(f"({pulseid}) problem ({e}) to read peakfinder parameters file, worker : {worker}", flush=True) + if not zmq_socks.has_data(): continue image, metadata = zmq_socks.get_data() - results = copy(metadata) - if results["shape"][0] == 2 and results["shape"][1] == 2: + if metadata["shape"] == [2, 2]: # this is used as marker for empty images continue + results = metadata.copy() + + pulseid = results.get("pulse_id", 0) results.update(peakfinder_parameters)