fix(factor): window_start对11月月末产非法日期2026-00-01——月数学0-based化根治(1-based减法%12归零;11月每夜班日度批+12月月度班start全非法流入vnpy查询,12-01首炸);回归锚钉2025-12-01 [vps] [no-doc]
This commit is contained in:
@@ -44,6 +44,15 @@ def test_window_start_twelve_months():
|
||||
assert window_start("2026-09-30", 12) == "2025-10-01"
|
||||
|
||||
|
||||
def test_window_start_december_month_math():
|
||||
"""11 月月末回归锚:1-based 月减法 %12 归零曾产 '2026-00-01'(月=00 非法)."""
|
||||
from sanguo_factor.monthly_batch import window_start
|
||||
assert window_start("2026-11-30") == "2025-12-01" # 含 11 月共 12 个月
|
||||
assert window_start("2026-12-31") == "2026-01-01"
|
||||
assert window_start("2026-01-31") == "2025-02-01"
|
||||
assert window_start("2026-09-30") == "2025-10-01" # 既有正确值不变
|
||||
|
||||
|
||||
def test_plan_batch_excludes_dead_and_labels(registry):
|
||||
plan = plan_batch(registry, "2026-09-30")
|
||||
assert plan["factor_names"] == ["vol_ma5"]
|
||||
|
||||
Reference in New Issue
Block a user