18 lines
537 B
Python
18 lines
537 B
Python
|
|
"""门禁结果序列化(供 HTTP / UI)。"""
|
|||
|
|
|
|||
|
|
from __future__ import annotations
|
|||
|
|
|
|||
|
|
from typing import Any
|
|||
|
|
|
|||
|
|
from app.features.evaluation.gating_service import GateResult
|
|||
|
|
|
|||
|
|
|
|||
|
|
def gate_result_to_details(result: GateResult) -> dict[str, Any]:
|
|||
|
|
return {
|
|||
|
|
"mean_baseline_composite": result.mean_baseline_composite,
|
|||
|
|
"mean_candidate_composite": result.mean_candidate_composite,
|
|||
|
|
"mean_delta": result.mean_delta,
|
|||
|
|
"per_case": result.per_case,
|
|||
|
|
"protected_regressions": result.protected_regressions,
|
|||
|
|
}
|