added/use Aggregator.is_ready

This commit is contained in:
2024-08-28 10:53:21 +02:00
parent 1e6af40d56
commit cb79be0a3e
2 changed files with 5 additions and 2 deletions

View File

@ -79,9 +79,9 @@ def calc_aggregation_ready(results, data, aggregator):
if "aggregation_max" not in results:
return False
n_aggregated_images = aggregator.counter
aggregation_max = results["aggregation_max"]
if n_aggregated_images < results["aggregation_max"]:
if not aggregator.is_ready(aggregation_max):
return False
aggregator.reset()

View File

@ -19,6 +19,9 @@ class Aggregator:
__iadd__ = add
def is_ready(self, nmax):
return (self.counter >= nmax)
def __repr__(self):
return f"{self.data!r} / {self.counter}"