Skip to content

Commit

Permalink
fix: data must be fetched and loaded per eval-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin1887 committed Aug 6, 2024
1 parent 2d4452b commit 78ff073
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lab/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion lab/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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} "
Expand Down
8 changes: 4 additions & 4 deletions lab/reports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 78ff073

Please sign in to comment.