From fd2345c6112dc7e18d9d6a4dc3111dd93be29a94 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 13 Aug 2024 13:48:45 +0200 Subject: [PATCH] aggregator changes are in-place --- dap/algos/forcesend.py | 14 +++++++------- dap/worker.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dap/algos/forcesend.py b/dap/algos/forcesend.py index 1c243b4..e0a1866 100644 --- a/dap/algos/forcesend.py +++ b/dap/algos/forcesend.py @@ -8,7 +8,7 @@ def calc_force_send(results, data, pixel_mask_pf, image, aggregator): force_send_visualisation = False if data.dtype == np.uint16: - return data, force_send_visualisation, aggregator + return data, force_send_visualisation apply_aggregation = results.get("apply_aggregation", False) apply_threshold = results.get("apply_threshold", False) @@ -18,15 +18,15 @@ def calc_force_send(results, data, pixel_mask_pf, image, aggregator): if not apply_aggregation and not apply_threshold: data = image - return data, force_send_visualisation, aggregator + return data, force_send_visualisation calc_apply_threshold(results, data) # changes data in place - data, force_send_visualisation, aggregator = calc_apply_aggregation(results, data, aggregator) + data, force_send_visualisation = calc_apply_aggregation(results, data, aggregator) calc_mask_pixels(data, pixel_mask_pf) # changes data in place - return data, force_send_visualisation, aggregator + return data, force_send_visualisation @@ -52,10 +52,10 @@ def calc_apply_aggregation(results, data, aggregator): apply_aggregation = results.get("apply_aggregation", False) if not apply_aggregation: - return data, force_send_visualisation, aggregator + return data, force_send_visualisation if "aggregation_max" not in results: - return data, force_send_visualisation, aggregator + return data, force_send_visualisation aggregator += data @@ -69,7 +69,7 @@ def calc_apply_aggregation(results, data, aggregator): force_send_visualisation = True aggregator.reset() - return data, force_send_visualisation, aggregator + return data, force_send_visualisation diff --git a/dap/worker.py b/dap/worker.py index 9f8c9f1..69ed855 100644 --- a/dap/worker.py +++ b/dap/worker.py @@ -116,7 +116,7 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host calc_peakfinder_analysis(results, pfdata, pixel_mask_pf) # ??? - data, force_send_visualisation, aggregator = calc_force_send(results, data, pixel_mask_pf, image, aggregator) + data, force_send_visualisation = calc_force_send(results, data, pixel_mask_pf, image, aggregator) results["type"] = str(data.dtype) results["shape"] = data.shape