fix integration helper

This commit is contained in:
valentin.boettcher@mailbox.tu-dresden.de 2023-03-06 11:21:24 -05:00
parent 3f7ffdd9e1
commit e6a0eb62e6
No known key found for this signature in database
GPG key ID: E034E12B7AF56ACE

View file

@ -190,12 +190,24 @@ def integrate_online(model, n, stream_folder=None, **kwargs):
)
def get_sample_count(model):
try:
with aux.get_data(model) as d:
return d.samples
except:
return 0
def integrate_online_multi(models, n, *args, increment=1000, **kwargs):
target = increment
while target < (n + target):
while target <= n:
current_target = min([n, target])
for model in models:
integrate_online(model, min([n, target]), *args, **kwargs)
count = get_sample_count(model)
if count < current_target:
integrate_online(model, current_target, *args, **kwargs)
target += increment