")
for stab in rows:
engine = str(stab.get("engine_name") or "?")
n_runs = int(stab.get("n_runs") or 0)
cer_mean = stab.get("cer_mean")
cer_stdev = stab.get("cer_stdev")
cer_cv = stab.get("cer_cv")
identical = stab.get("identical_run_rate")
n_distinct = stab.get("n_distinct_outputs")
if isinstance(cer_mean, (int, float)) and isinstance(cer_stdev, (int, float)):
cer_str = f"{cer_mean * 100:.2f}% ± {cer_stdev * 100:.2f}%"
elif isinstance(cer_mean, (int, float)):
cer_str = f"{cer_mean * 100:.2f}%"
else:
cer_str = "—"
if isinstance(cer_cv, (int, float)):
cv_color = color_traffic_light(float(cer_cv), low_is_good=True, scale_max=0.25)
cv_cell = (
f'| {float(cer_cv) * 100:.1f} | '
)
else:
cv_cell = (
'— | '
)
identical_str = (
f"{float(identical) * 100:.1f}"
if isinstance(identical, (int, float)) else "—"
)
distinct_str = str(n_distinct) if isinstance(n_distinct, int) else "—"
parts.append(
f''
f'| {_e(engine)} | '
f'{n_runs} | '
f'{cer_str} | '
f'{cv_cell}'
f'{identical_str} | '
f'{distinct_str} | '
f'
'
)
parts.append("