danieldeutsch/sacrerouge

Calculating correlation edits the input metrics

danieldeutsch opened this issue · 0 comments

During the correlation calculation, multiple metrics objects are merged into one

for metrics in metrics_list:
if metrics.summarizer_id not in metrics_dicts[metrics.instance_id]:
metrics_dicts[metrics.instance_id][metrics.summarizer_id] = metrics
else:
metrics_dicts[metrics.instance_id][metrics.summarizer_id].merge(metrics)

If someone calls correlate multiple times in a row, it will mess up the results. This should not happen. We should instead make a copy of all of the objects so we don't change the input objects.