Skip to content

Commit

Permalink
update sublocation, and honour recursive argument
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Apr 2, 2024
1 parent a744784 commit 746e8ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "stimela"
version = "2.0rc17"
version = "2.0rc18"
description = "Framework for system agnostic pipelines for (not just) radio interferometry"
authors = ["Sphesihle Makhathini <[email protected]>", "Oleg Smirnov and RATT <[email protected]>"]
readme = "README.rst"
Expand Down
22 changes: 11 additions & 11 deletions 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,27 +625,27 @@ 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)):
elif isinstance(value, (dict, DictConfig)) and recursive:
params_out[name] = self.evaluate_dict(
value,
corresponding_ns,
defaults,
sublocation,
raise_substitution_errors,
recursive,
verbose
sublocation=sublocation + [name],
raise_substitution_errors=raise_substitution_errors,
recursive=True,
verbose=verbose
)
elif isinstance(value, (list, ListConfig)):
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,
raise_substitution_errors,
recursive,
verbose
sublocation=sublocation + [name],
raise_substitution_errors=raise_substitution_errors,
recursive=True,
verbose=verbose
).values()
]
)
Expand Down

0 comments on commit 746e8ae

Please sign in to comment.