From d43866b359cff7fc6e62e15b2a51b877e70ae0bf Mon Sep 17 00:00:00 2001 From: Young Joon Lee Date: Sun, 16 Jul 2023 10:18:53 +0900 Subject: [PATCH] fix(hyfi/core/config): remove run method from HyfiConfig class --- src/hyfi/core/config.py | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/hyfi/core/config.py b/src/hyfi/core/config.py index dab95e9a..6be91187 100644 --- a/src/hyfi/core/config.py +++ b/src/hyfi/core/config.py @@ -2,7 +2,7 @@ Hyfi configuration file. """ import os -from typing import Any, Optional, Union +from typing import Any, List, Optional, Union from omegaconf import DictConfig from pydantic import ( @@ -15,13 +15,11 @@ ) from hyfi.about import AboutConfig, __app_name__, __version__ -from hyfi.copier import Copier from hyfi.core import __about__, __hydra_config__ from hyfi.dotenv import DotEnvConfig -from hyfi.pipeline import PipelineConfig, PIPELINEs +from hyfi.pipeline import PipelineConfig from hyfi.project import ProjectConfig from hyfi.task import TaskConfig -from hyfi.utils.conf import CONFs from hyfi.utils.envs import ENVs from hyfi.utils.logging import LOGGING from hyfi.utils.notebooks import NBs @@ -50,6 +48,7 @@ class HyfiConfig(BaseModel): pipeline: Optional[PipelineConfig] = None task: Optional[TaskConfig] = None workflow: Optional[WorkflowConfig] = None + tasks: Optional[List[str]] = None _version_: str = PrivateAttr(__version__()) _initilized_: bool = PrivateAttr(False) @@ -291,19 +290,6 @@ def print_about(self): if pkg_name: print(f"\nExecute `{pkg_name} --help` to see what you can do with {name}") - def run(self, target: Optional[str] = None): - """Run the config""" - if self.workflow is not None and (target is None or target == "workflow"): - PIPELINEs.run_workflow(self.workflow) - elif self.task is not None and (target is None or target == "task"): - PIPELINEs.run_task(self.task, project=self.project) - elif self.copier is not None and (target is None or target == "copier"): - args = CONFs.to_dict(self.copier) - with Copier(**args) as worker: - worker.run_copy() - else: - self.print_about() - __global_config__ = HyfiConfig() if __global_config__.about: