Skip to content

Commit

Permalink
fix(hyfi): update condition checks in run method
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jul 16, 2023
1 parent d43866b commit 1ef744a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hyfi/main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,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(**cfg["workflow"])
if "tasks" in cfg:
workflow = HyFI.workflow(**cfg)
HyFI.run_workflow(workflow)
elif "task" in cfg and (target is None or target == "task"):
project = HyFI.init_project(**cfg["project"]) if "project" in cfg else None
Expand All @@ -367,4 +365,6 @@ def run(cfg: Union[Dict, DictConfig], target: Optional[str] = None):
with Copier(**cfg) as worker:
worker.run_copy()
else:
if target and target not in cfg:
logger.warning("Target %s not found in config", target)
HyFI.about()

0 comments on commit 1ef744a

Please sign in to comment.