"""Diagnostic: confirm multi-symbol factor analysis produces real IC on real data. Guarded entry for spawn-friendly multiprocessing. Throwaway.""" import sys import os import traceback _VNPY_SRC = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "vnpy_v4.4.0")) _REPO = os.path.dirname(_VNPY_SRC) for _p in (_REPO, _VNPY_SRC): if _p not in sys.path: sys.path.insert(0, _p) def main(): import sanguo_factor # registers built-in factors from sanguo_factor.registry import get_factor from sanguo_factor.analyzer import run_factor_analysis from sanguo_data.config import load_config print("ma5 registered:", get_factor("ma5") is not None) cfg = load_config("/app/config/data_platform.yaml") symbols = ["600000", "000001", "300750"] # multi-symbol for cross-section print(f"symbols={symbols} range=2024-01-01..2024-06-30") try: report = run_factor_analysis( symbols, ["ma5"], "2024-01-01", "2024-06-30", cfg, output_dir="/tmp/diag_factor", ) print("=== ic_summary ===") print(report.ic_summary) print("=== report_paths ===") print(report.report_paths) except Exception: traceback.print_exc() if __name__ == "__main__": main()