Files
easy_tdx_max/pyproject.toml
T
GitHub b2509a8d0e release: v1.25.0 — Walk-Forward/适配性/一条龙评估防过拟合链 + 评分评级后端化 + 寻优加速
升级计划 P1:补上两个下游项目都在自研的样本外验证空白。

- Walk-Forward 引擎(walkforward.py):7 窗样本外、每窗独立开仓(backtest-system v1.2.1 踩坑语义)、
  上下文预热不污染;CLI --wf、REST /backtest/wf/run/async
- 适配性评估(fitness.py):train/valid/test 三段 + 8 项可解释检查 + 高适配标记;
  evaluate_prefix 滚动过滤原语(无未来泄漏)
- 一条龙评估(benchmark.py evaluate_strategy):回测+WF+适配性+评分+评级+买入持有基准对比;
  CLI --evaluate、REST /backtest/evaluate/run/async
- 综合评分(scoring.py,收益50/夏普15/回撤10/Sortino5/WF20)+ 评级后端化(grading.py,
  前端 TS 忠实移植,REST 响应新增 grade/score 字段)
- 多 seed 验证 + 四项晋级门槛(validation.py);REST /backtest/multiseed/run/async
- 寻优两段式加速:IndicatorCache(36 点网格命中率 41.7%)+ workers 进程并行(实测约 2x);
  诚实注:指标缓存墙钟 ~1.01x,瓶颈在逐 bar 循环,后续向量化
- strategy.I() 指标缓存钩子 + 数据代理零拷贝(astype copy=False);
  types.to_json_native 统一 numpy 清洗
2026-09-01 22:17:08 +08:00

86 lines
2.7 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "easy-tdx"
version = "1.25.0"
description = "通达信 TCP 协议行情数据客户端,支持在线行情、离线数据读取与写入同步"
readme = "README.md"
requires-python = ">=3.10"
dependencies = ["pandas>=2.0,<3", "tzdata>=2024.1", "click>=8.0,<9"]
[project.scripts]
easy-tdx = "easy_tdx.cli:cli" # cli/__init__.py exposes the click group
[project.optional-dependencies]
dev = ["pytest>=8.0", "pytest-asyncio>=0.23", "pytest-cov", "mypy>=1.9", "ruff>=0.4", "scipy>=1.10,<1.16", "httpx>=0.27"]
science = ["scipy>=1.10,<1.16"]
web = ["fastapi>=0.110,<1", "uvicorn[standard]>=0.29"]
# 打包成桌面 EXE 用:系统托盘(pystray+ 图标生成(Pillow)。
# 仅 PyInstaller 打包态需要,开发态 ``pip install -e .[web]`` 不强制装。
packaging = ["pystray>=0.19", "Pillow>=10.0"]
[tool.hatch.build]
# 前端 dist 是构建产物(在 .gitignore 里),hatchling 默认不打包。
# artifacts 让它被 sdist 和 wheel 都强制包含。
artifacts = [
"web-ui/dist/",
]
[tool.hatch.build.targets.wheel]
packages = ["src/easy_tdx"]
# 前端 dist 映射到包内 easy_tdx/web/dist/。CIci.yml)、publishpublish.yml
# 和 releaserelease.yml)都会在 pip install / build 前先 npm run build。
force-include = { "web-ui/dist" = "easy_tdx/web/dist" }
[tool.mypy]
strict = true
python_version = "3.12"
# 跳过未跟踪的本地脚本(依赖外部 unified_config/sqlalchemy/requests,不属于库)
exclude = ["src/easy_tdx/exchange_margin\\.py"]
[[tool.mypy.overrides]]
module = ["pandas", "tabulate", "matplotlib", "matplotlib.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "easy_tdx.MyTT"
# Type stubs provided via MyTT.pyi — keep strict checks enabled
[[tool.mypy.overrides]]
module = ["fastapi.*", "uvicorn.*", "pydantic.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# pystray / Pillow 无 type stubstray.py 已用 type: ignore 兜底关键调用
module = ["pystray", "pystray.*", "PIL", "PIL.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["scipy", "scipy.*"]
ignore_missing_imports = true
[tool.ruff]
target-version = "py310"
line-length = 100
extend-exclude = ["*.pyi", "src/easy_tdx/exchange_margin.py"]
[tool.ruff.lint]
select = ["E", "F", "I", "UP"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=short"
asyncio_mode = "auto"
[tool.coverage.run]
source = ["easy_tdx"]
omit = ["tests/*"]
[tool.coverage.report]
# 覆盖率门槛。从 50 提升到 60(审计 #9):补充 reconnect/bitmap/config 测试后
# 实测约 61%。进一步提到 70 需补 web/ 路由与更多 client 镜像测试,留待后续。
fail_under = 60
show_missing = true