release: v1.27.0 — 通达信公式解析器三通道 + 轮动组合引擎 + 回测页WF/评估开关 + Docker 部署

升级计划 P3 + P4(部分)。全量 1252 单测、ruff/mypy strict、前端 vue-tsc+vite build 全绿。

- 通达信公式解析器(formula.py):自建 tokenizer + 递归下降 AST + 30+ 函数白名单求值
  (不走 Python eval);命名布尔输出=信号列、数值输出=排名列;除零→NaN、预热期不出信号
- 公式三通道:CLI easy-tdx formula compute|screen|backtest;REST /formula/validate|compute|
  backtest|screen(run/async);Python API run_formula_backtest(买/卖列自动挑选)
- 轮动组合引擎(rotation.py):排名定期换仓(打分只用截至当日数据)、槽位等额、
  跌出排名自动补位、日/周/月刷新、槽内止盈止损;momentum_score/formula_score 打分;
  REST /backtest/rotation/run/async
- 回测页附加分析开关(Web UI):勾选后随回测并行跑 WF(逐窗红涨绿跌柱状图+汇总卡,
  窗口数 2~12)与一条龙评估(评分分项条/高适配徽标/买入持有对比/8 项适配检查);
  新增 WalkForwardPanel/EvaluatePanel 组件与 store runWalkforward/runEvaluate;
  WF 端点 ?n_windows= 透传;修复报告 numpy 标量 REST 400(源头清洗)
- Docker 部署(Dockerfile + docker-compose.yml,/data 卷 + 健康检查)与
  scripts/verify_ci.sh 一键门禁
- 升级计划文档 docs/upgrade-plan-2026H2.md(四阶段全部完成 + 诚实实测数据)
- 未做(独立排期):Playwright E2E、WebSocket 实时联动、引擎逐 bar 向量化
This commit is contained in:
GitHub
2026-09-01 22:17:57 +08:00
parent 9569b2653c
commit 917295edaf
23 changed files with 3135 additions and 5 deletions
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# easy-tdx 一键本地门禁(等价 CI 的质量检查,v1.27 新增)。
#
# 用法:bash scripts/verify_ci.sh [--fast]
# --fast 跳过全量测试(只跑 ruff + mypy + 格式检查)
#
# 可选安装为 git hookpre-push):
# ln -s ../../scripts/verify_ci.sh .git/hooks/pre-push
set -euo pipefail
cd "$(dirname "$0")/.."
PY="${PYTHON:-.venv/Scripts/python.exe}"
if [ ! -f "$PY" ]; then
PY="${PYTHON:-.venv/bin/python}"
fi
if [ ! -f "$PY" ]; then
PY="python"
fi
FAST=0
[ "${1:-}" = "--fast" ] && FAST=1
echo "── ruff check ──────────────────────────────────────────"
"$PY" -m ruff check src/ tests/
echo "── ruff format --check ─────────────────────────────────"
"$PY" -m ruff format --check src/ tests/
echo "── mypy --strict ───────────────────────────────────────"
"$PY" -m mypy src/easy_tdx/
if [ "$FAST" = "1" ]; then
echo "── 跳过测试(--fast)───────────────────────────────────"
echo "✓ verify_ci (fast) 全部通过"
exit 0
fi
echo "── pytest(全量单元测试)────────────────────────────────"
"$PY" -m pytest tests/ -q --ignore=tests/integration
echo ""
echo "✓ verify_ci 全部通过"