Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into issue-275
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Apr 17, 2024
2 parents dcfc181 + aed211e commit 3ff16f4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
27 changes: 26 additions & 1 deletion scabha/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()):
Expand Down Expand Up @@ -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


Expand Down
1 change: 1 addition & 0 deletions stimela/stimelogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 3ff16f4

Please sign in to comment.