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:
|
if "aggregation_max" not in results:
|
||||||
return False
|
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
|
return False
|
||||||
|
|
||||||
aggregator.reset()
|
aggregator.reset()
|
||||||
|
@ -19,6 +19,9 @@ class Aggregator:
|
|||||||
|
|
||||||
__iadd__ = add
|
__iadd__ = add
|
||||||
|
|
||||||
|
def is_ready(self, nmax):
|
||||||
|
return (self.counter >= nmax)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return f"{self.data!r} / {self.counter}"
|
return f"{self.data!r} / {self.counter}"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user