refactor : BaseFactory 基类类型自动推导 + 移除冗余代码
- _validate_component 从 BaseFactory[T] 泛型参数自动解析基类类型,9 个子类覆写移除 - Registry 类内联到 BaseFactory._entries,移除未用的 list_by_category/list_by_priority - _component_base 在 __init_subclass__ 时立即解析 - 数据集 4 个子类冗余 __init__ 移除
This commit is contained in:
@@ -291,7 +291,7 @@ def test_sectioned_text_too_short(test_tokenizer):
|
||||
|
||||
|
||||
def test_factory_registered():
|
||||
names = MaskBuilderFactory._registry.list_names()
|
||||
names = MaskBuilderFactory.list_registered()
|
||||
assert "sectioned" in names
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user