From 78ff0734503be56ab53ba666fcb5cc35c76043dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Pozo?= Date: Tue, 6 Aug 2024 13:09:30 +0200 Subject: [PATCH] fix: data must be fetched and loaded per eval-dir --- lab/experiment.py | 2 +- lab/fetcher.py | 2 +- lab/reports/__init__.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lab/experiment.py b/lab/experiment.py index 20145fb45..1d0afe5d4 100644 --- a/lab/experiment.py +++ b/lab/experiment.py @@ -378,7 +378,7 @@ def __init__(self, path=None, environment=None): self.parsers = [] # This attribute will be set by the first report that loads data. - self.props = tools.Properties() + self.props = {} self.set_property("experiment_file", self._script) diff --git a/lab/fetcher.py b/lab/fetcher.py index fc1ab28b9..9a1328352 100644 --- a/lab/fetcher.py +++ b/lab/fetcher.py @@ -162,7 +162,7 @@ def __call__(self, src_dir, eval_dir=None, merge=None, filter=None, **kwargs): tools.makedirs(eval_dir) combined_props.write() - self.exp.props = combined_props + self.exp.props[eval_dir] = combined_props func = logging.info if unexplained_errors == 0 else logging.warning func( f"Wrote properties file. It contains {unexplained_errors} " diff --git a/lab/reports/__init__.py b/lab/reports/__init__.py index 7383680c9..fe87e8fff 100644 --- a/lab/reports/__init__.py +++ b/lab/reports/__init__.py @@ -414,15 +414,15 @@ def _scan_data(self): self._all_attributes = self._get_type_map(attributes) def _load_data(self): - if not self.exp.props: + if self.eval_dir not in self.exp.props or not self.exp.props[self.eval_dir]: props_file = os.path.join(self.eval_dir, "properties") logging.info("Reading properties file") - self.exp.props = tools.Properties(filename=props_file) - if not self.exp.props: + self.exp.props[self.eval_dir] = tools.Properties(filename=props_file) + if not self.exp.props[self.eval_dir]: logging.critical(f"No properties found in {self.eval_dir}") logging.info("Reading properties file finished") - self.props = self.exp.props + self.props = self.exp.props[self.eval_dir] def _apply_filter(self): # Removing elements would require a deepcopy of self.exp.props, with