added/use Aggregator.is_ready
This commit is contained in:
@ -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()
|
||||
|
@ -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}"
|
||||
|
||||
|
Reference in New Issue
Block a user