From 78543669c3e19947968980877b2d5a75a6ca892f Mon Sep 17 00:00:00 2001 From: starfall <1186454801@qq.com> Date: Mon, 9 Dec 2024 22:27:09 +0800 Subject: [PATCH] clean --- example/configs/detail.toml | 2 -- excore/config/models.py | 4 ++-- excore/plugins/yolo_config.py | 24 ------------------------ 3 files changed, 2 insertions(+), 28 deletions(-) delete mode 100644 example/configs/detail.toml delete mode 100644 excore/plugins/yolo_config.py diff --git a/example/configs/detail.toml b/example/configs/detail.toml deleted file mode 100644 index ea1e5a5..0000000 --- a/example/configs/detail.toml +++ /dev/null @@ -1,2 +0,0 @@ -[Backbone.ResNet] -$target = [] diff --git a/excore/config/models.py b/excore/config/models.py index 2865650..d7ae807 100644 --- a/excore/config/models.py +++ b/excore/config/models.py @@ -233,8 +233,8 @@ def validate(self) -> None: def __call__(self, **params: NodeParams) -> NodeInstance | ConfigHookSkipFlag | Hook: if issubclass(self.cls, ConfigArgumentHook): return None - params = self._update_params(**params) - return self._instantiate(params) + self._update_params(**params) + return self._instantiate() class ReusedNode(InterNode): diff --git a/excore/plugins/yolo_config.py b/excore/plugins/yolo_config.py deleted file mode 100644 index 9762f39..0000000 --- a/excore/plugins/yolo_config.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import TYPE_CHECKING - -from ..config.models import ModuleNode, register_special_flag - -if TYPE_CHECKING: - from ..config.models import NoCallSkipFlag, NodeInstance, NodeParams - - -class DetailNode(ModuleNode): - priority = 2 - module_key = "target" - - def _update_params(self, **params: NodeParams): - if DetailNode.module_key not in self: - raise RuntimeError() - super()._update_params(**params) - - def __call__(self, **params: NodeParams) -> NoCallSkipFlag | NodeInstance: - pass - - -def enable_detialed_confing(special_flag: str = "*", module_key: str = "target") -> None: - DetailNode.module_key = module_key - register_special_flag(special_flag, DetailNode)