From 5cc326dd4aed95b0cad9741c22d7558a7519fc39 Mon Sep 17 00:00:00 2001 From: claude_dev Date: Sun, 30 Aug 2026 10:53:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(factor):=20output=5Fdir=E5=BB=BA=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=85=9C=E5=BA=95=E2=80=94=E2=80=94VPS(Windows)?= =?UTF-8?q?=E9=A6=96=E8=B7=91/tmp/factor=E4=B8=8D=E5=AD=98=E5=9C=A8tears?= =?UTF-8?q?=E9=9D=99=E9=BB=98=E5=A4=B1=E8=B4=A5=20[vps]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API路径output_dir硬编码/tmp/factor是容器/NAS约定;Windows解析为当前盘根 \tmp\factor,首跑不存在且tears/心跳open直写不建目录→FileNotFoundError →tears标注json_error静默降级+心跳全丢。os.makedirs exist_ok幂等修复, 赶上统一推vps班车。factor全套测绿 --- sanguo_factor/analyzer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sanguo_factor/analyzer.py b/sanguo_factor/analyzer.py index 975c82d..772ea6c 100644 --- a/sanguo_factor/analyzer.py +++ b/sanguo_factor/analyzer.py @@ -152,6 +152,11 @@ def run_factor_analysis( report_paths={} ) + # 输出目录兜底建目录:API 路径 output_dir="/tmp/factor" 是容器/NAS 约定, + # VPS(Windows)首跑时该路径不存在 → tears JSON/心跳文件 open 直写会 + # FileNotFoundError → tears 静默失败。exist_ok 幂等,已存在零成本。 + os.makedirs(output_dir, exist_ok=True) + # Create AlphaLab session and load symbols session = AlphaLabSession(lab_path=output_dir) # 逐只加载 + 心跳(分钟级任务的可观测性:行情加载 i/N)