fix(hn): proper NoneType handling in EVAL writer

This commit is contained in:
openresearch 2026-07-04 08:49:49 +00:00
parent 07adc46931
commit 79433aadfc

View file

@ -357,13 +357,14 @@ def write_eval(results):
"|-------|---|---|-------|------|---------|--------|------------|------|---------|-----|",
]
for g in results["graphs"]:
ww = g['welch_wynn']
ww = g.get('welch_wynn')
ww_str = f"{ww:.4f}" if ww is not None else "N/A"
hb = g.get('hoffman_bound')
hb_str = f"{hb:.4f}" if hb is not None else "inf"
lines.append(
f"| {g['description']} | {g['n_vertices']} | {g['n_edges']} | "
f"{g['lambda_max']:.4f} | {g['lambda_min']:.4f} | "
f"{g['hoffman_bound']:.4f} if g['hoffman_bound'] is not None else 'inf' | "
f"{g['chi_hoffman']} | {ww_str} | "
f"{hb_str} | {g['chi_hoffman']} | {ww_str} | "
f"{g['chi_welch_wynn']} | {g['chi_known']} | {g['gap']} |"
)