统一 DEB 数据源为单一计算路径

getModelView 优先使用根级 detail.deb.prediction 保证与 AI 证据面板一致,
_build_city_detail_payload 补上缺失的 deb 和 multi_model_daily 字段,
_analyze_summary 补上 LGBM 增强步骤使其与 _analyze 产出相同的 DEB 值。

Constraint: 三个入口 (panel/full/summary) 的 DEB 必须经过同一套 calculate_dynamic_weights + LGBM 重算流程
Tested: ruff + tsc 全过
This commit is contained in:
2569718930@qq.com
2026-05-06 18:24:15 +08:00
parent 2f73828d4d
commit a684586cb4
2 changed files with 48 additions and 2 deletions
+3 -2
View File
@@ -37,15 +37,16 @@ export function getProbabilityView(detail: CityDetail, targetDate?: string | nul
export function getModelView(detail: CityDetail, targetDate?: string | null) {
const date = targetDate || detail.local_date;
const daily = detail.multi_model_daily?.[date];
const deb = detail.deb?.prediction ?? daily?.deb?.prediction ?? null;
if (daily) {
return {
deb: daily.deb?.prediction ?? null,
deb,
models: daily.models || {},
};
}
return {
deb: detail.deb?.prediction ?? null,
deb,
models: detail.multi_model || {},
};
}