Skip to content

Commit

Permalink
fix(hyfi): add target validation in run function
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jul 9, 2023
1 parent 558ffea commit f3be797
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hyfi/main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ def viewsource(obj):
@staticmethod
def run(cfg: Union[Dict, DictConfig], target: Optional[str] = None):
"""Run the config"""
if target and target not in cfg:
raise ValueError(f"No {target} configuration found")
if "workflow" in cfg and (target is None or target == "workflow"):
workflow = HyFI.workflow_config(**cfg["workflow"])
HyFI.run_workflow(workflow)
Expand Down

0 comments on commit f3be797

Please sign in to comment.