From 1ef744a9acc1eec85b1fc1737398b3c3ac399110 Mon Sep 17 00:00:00 2001 From: Young Joon Lee Date: Sun, 16 Jul 2023 10:19:08 +0900 Subject: [PATCH] fix(hyfi): update condition checks in run method --- src/hyfi/main/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hyfi/main/__init__.py b/src/hyfi/main/__init__.py index 240b6ea3..ba8155bc 100644 --- a/src/hyfi/main/__init__.py +++ b/src/hyfi/main/__init__.py @@ -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 @@ -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()