完善评估能力:筛选参数 + degraded 排除 + 前端评估页
后端: - settle_prediction 拒绝 degraded/failed(明确错误信息) - get_eval_summary 支持 provider/model/prompt_version/mode 筛选 - 返回 filtered_settled/evaluated/skipped_degraded 等计数 - matches 游标分页方向修复(scheduled ASC 用 > 条件) - available_at 加 2h 缓冲(近似完赛时间) - bzzziro 统计字段映射注释(待真实响应验证) - injuries 区分 no_local_data 与 success 空名单 前端: - 新增 EvalPage(筛选控件 + 汇总卡片 + 准确率表格) - 挂载 /admin/eval 路由与导航 测试: - test_matches_cursor.py:游标方向 - test_available_at.py:2h 缓冲与回测防泄漏 - test_bzzoirot_stats.py:统计字段映射 - test_injuries_no_local_data.py:no_local_data vs success - test_injuries_inserted_count.py:失败批不计入 - test_eval_excludes_degraded.py:degraded 排除准确率
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
"""回归测试: bzzoiro 采集链路正确映射射门/控球/角球/xG。
|
||||
"""回归测试: bzzoiro 采集链路统计字段映射。
|
||||
|
||||
验证:
|
||||
1. normalize_bzzoiro 正确映射统计字段
|
||||
2. 入库条件不再强制要求 xG(任一统计字段即可)
|
||||
3. API 没有的字段保持 None,不伪造
|
||||
⚠️ 重要说明:
|
||||
当前字段名基于常见足球 API 模式推测,未经真实 bzzoiro 响应校验。
|
||||
以下测试验证的是「若真实字段与推测一致,映射应正确」的假设。
|
||||
|
||||
待用户提供真实 event 样例后,需核对并修正以下字段名:
|
||||
- 射门: home_shots / away_shots
|
||||
- 射正: home_shots_on_target / away_shots_on_target
|
||||
- 角球: home_corners / away_corners
|
||||
- 控球: home_possession
|
||||
- xG: home_xg / away_xg
|
||||
- 黄牌: home_yellow_cards / away_yellow_cards
|
||||
- 红牌: home_red_cards / away_red_cards
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime, timezone
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -16,7 +23,7 @@ from src.data.normalize import NormalizedMatch, normalize_bzzoiro
|
||||
|
||||
|
||||
class TestNormalizeBzzoirotStats:
|
||||
"""normalize_bzzoiro 应正确映射统计字段。"""
|
||||
"""normalize_bzzoiro 应正确映射统计字段(基于推测字段名)。"""
|
||||
|
||||
def test_maps_shots(self):
|
||||
"""API 提供 shots 字段时应正确映射。"""
|
||||
|
||||
Reference in New Issue
Block a user