feat(factor): 挂载 vnpy Alpha101(82)+Alpha158(158) 全量表达式进注册表——空df实例化零成本提取,导入即注册,幂等 [vps]

This commit is contained in:
2026-08-25 00:01:41 +08:00
parent ec5a55c5f7
commit 51137a8268
4 changed files with 114 additions and 5 deletions
+5 -5
View File
@@ -10,12 +10,12 @@ import tempfile
def test_builtin_factors_registered_on_import():
"""Test that importing sanguo_factor registers built-in factors (Root cause A fix)."""
# Reimport to ensure registration runs
import importlib
import sanguo_factor
importlib.reload(sanguo_factor)
from sanguo_factor.registry import _REGISTRY, get_factor
from sanguo_factor import library
from sanguo_factor.registry import get_factor
# Clear registry and re-register to test fresh registration
_REGISTRY.clear()
library._register_all()
# Verify built-in factors are registered
ma5_factor = get_factor("ma5")