From 68948765e6da5d0c6242dfe4158869fa3da3bbb2 Mon Sep 17 00:00:00 2001 From: Ondrej Lichtner Date: Wed, 14 Feb 2024 14:42:23 +0100 Subject: [PATCH] LrcFile: fix reading baseline evaluation results after refactor The data is now stored directly as a dataclass instead of a dictionary in the `data` property. Signed-off-by: Ondrej Lichtner --- lrc_file/LrcFile.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lrc_file/LrcFile.py b/lrc_file/LrcFile.py index 8da0ef5..457f587 100644 --- a/lrc_file/LrcFile.py +++ b/lrc_file/LrcFile.py @@ -308,14 +308,14 @@ def _evaluation_data(self, result_type: type): evaluation_data = {} for result in self.evaluation_results: - for comparison in result.data["comparisons"]: - if not isinstance(comparison["current_result"], result_type): + for comparison in result.comparisons: + if not isinstance(comparison.current_result, result_type): continue - evaluated_metric = comparison["metric_name"] + evaluated_metric = comparison.metric_name evaluated_metric_name = re.sub("^[0-9]+_", "", evaluated_metric) evaluation_data[evaluated_metric] = getattr( - comparison["current_result"], evaluated_metric_name + comparison.current_result, evaluated_metric_name ).average return evaluation_data