diff --git a/scabha/evaluator.py b/scabha/evaluator.py index 42ac41e..ee19cc8 100644 --- a/scabha/evaluator.py +++ b/scabha/evaluator.py @@ -580,7 +580,7 @@ def evaluate_dict(self, params: Dict[str, Any], defaults: Dict[str, Any] = {}, sublocation = [], raise_substitution_errors: bool = True, - recursive: bool = False, + recursive: bool = True, verbose: bool = False): params_out = params for name, value in list(params.items()): @@ -625,6 +625,31 @@ def evaluate_dict(self, params: Dict[str, Any], params_out[name] = new_value if corresponding_ns: corresponding_ns[name] = new_value + elif isinstance(value, (dict, DictConfig)) and recursive: + params_out[name] = self.evaluate_dict( + value, + corresponding_ns, + defaults, + sublocation=sublocation + [name], + raise_substitution_errors=raise_substitution_errors, + recursive=True, + verbose=verbose + ) + elif isinstance(value, (list, ListConfig)) and recursive: + params_out[name] = type(value)( + [ + *self.evaluate_dict( + {f"[{i}]": v for i, v in enumerate(value)}, + corresponding_ns, + defaults, + sublocation=sublocation + [name], + raise_substitution_errors=raise_substitution_errors, + recursive=True, + verbose=verbose + ).values() + ] + ) + return params_out diff --git a/stimela/stimelogging.py b/stimela/stimelogging.py index c477957..2921687 100644 --- a/stimela/stimelogging.py +++ b/stimela/stimelogging.py @@ -304,6 +304,7 @@ def update_file_logger(log: logging.Logger, logopts: DictConfig, nesting: int = setup_file_logger(log, path, level=logopts.level, symlink=logopts.symlink) else: disable_file_logger(log) + log.propagate = True def get_logfile_dir(log: logging.Logger):