Readded the try except block to shifted_correlation.

This commit is contained in:
sebastiankloth 2023-06-27 17:29:36 +02:00
parent a1d0cee510
commit 8146a9b270

View File

@ -192,13 +192,22 @@ def shifted_correlation(
)
else:
pool = ProcessPool(nodes=nodes)
try:
result = np.array(
pool.map(partial(get_correlation, idx=idx, selector=selector), start_frames)
pool.map(
partial(get_correlation, idx=idx, selector=selector), start_frames
)
)
except Exception:
logger.warning(
"WARNING: Something went wrong during multiprocessing "
"in shifted_correlation."
)
finally:
pool.terminate()
pool.restart()
if average == True:
if average:
clean_result = []
for entry in result:
if np.all(entry == 0):