From 4db7f4f8cdbad30c5d1ec2764fd3ccb513c9ffcf Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 30 Aug 2024 14:53:05 +0200 Subject: [PATCH] moved "not ready" due to missing aggregation_max into Aggregator --- dap/algos/aggregation.py | 5 +---- dap/utils/aggregator.py | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dap/algos/aggregation.py b/dap/algos/aggregation.py index afff5d7..baf317e 100644 --- a/dap/algos/aggregation.py +++ b/dap/algos/aggregation.py @@ -63,10 +63,7 @@ def calc_aggregation_ready(results, aggregator): if not apply_aggregation: return False - if "aggregation_max" not in results: - return False - - aggregation_max = results["aggregation_max"] + aggregation_max = results.get("aggregation_max") if not aggregator.is_ready(aggregation_max): return False diff --git a/dap/utils/aggregator.py b/dap/utils/aggregator.py index 1d3cfab..d1f18f7 100644 --- a/dap/utils/aggregator.py +++ b/dap/utils/aggregator.py @@ -20,6 +20,8 @@ class Aggregator: __iadd__ = add def is_ready(self, nmax): + if nmax is None: + return False return (self.counter >= nmax) def __repr__(self):