Skip to content

Commit 7ec09f6

Browse files
committed
refactor: [config] resolve wildcards on load
Resolve as many wildcards as possible on config load. Now that the overrides have moved back into the config loading stage the overridden fields are not having their wildcards resolved for some reason. It is useful to do this anyway as we then have more resolved config values in the saved project config Signed-off-by: James McCorrie <[email protected]>
1 parent cb9fbe2 commit 7ec09f6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/dvsim/project.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
rm_path,
2121
run_cmd_with_timeout,
2222
)
23+
from dvsim.utils.wildcards import find_and_substitute_wildcards
2324

2425
__all__ = ("Project",)
2526

@@ -216,12 +217,21 @@ def _load_flow_config(
216217

217218
if "cfgs" in cfg:
218219
# add any missing rel_path fields
219-
for child_cfg in cfg["cfgs"].values():
220+
for child_cfg_path in cfg["cfgs"]:
221+
child_cfg = cfg["cfgs"][child_cfg_path]
222+
220223
if "rel_path" not in child_cfg:
221224
child_cfg["rel_path"] = child_cfg["self_dir"].relative_to(
222225
root_path,
223226
)
224227

228+
# resolve as many wildcards as possible at this stage
229+
cfg["cfgs"][child_cfg_path] = find_and_substitute_wildcards(
230+
obj=child_cfg,
231+
wildcard_values=child_cfg,
232+
ignore_error=True,
233+
)
234+
225235
return TopFlowConfig.model_validate(cfg)
226236

227237
return FlowConfig.model_validate(cfg)

0 commit comments

Comments
 (0)