From 075e8728cb2c93107c291d4afb3fb3bfb697dd2b Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 10 Sep 2026 09:30:25 +0000 Subject: [PATCH] =?UTF-8?q?Score=20bars:=20rich-style=20half-cell=20glyphs?= =?UTF-8?q?=20(=E2=94=81=E2=94=81=E2=94=81=E2=95=B8=E2=95=8C=E2=95=8C)=20r?= =?UTF-8?q?eplacing=20block=20chars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- evalharness/cli.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/evalharness/cli.py b/evalharness/cli.py index 6874585..448dee0 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -262,12 +262,19 @@ def _print_result_panel(console, rep, wall_s: float = 0.0): body = Table(show_header=False, box=None, padding=(0, 2)) body.add_column('k', style='dim', no_wrap=True) body.add_column('v', overflow='fold') + def score_bar(v, width=22): + # rich-Bar-style glyphs with half-cell precision: ━━━╸╌╌ + filled = max(0.0, min(1.0, v)) * width + full = int(filled) + half = '╸' if filled - full >= 0.5 else '' + return '━' * full + half + '╌' * (width - full - len(half)) + for m, v in metrics: if m == 'extraction_failure_rate': continue - bar = Text('█' * int(round(v * 24)) + '·' * (24 - int(round(v * 24)))) - bar.stylize(color(v)) - body.add_row(m, Text.assemble(f'{v * 100:6.1f}% ', bar)) + body.add_row(m, Text.assemble( + (f'{v * 100:6.1f}% ', f'bold {color(v)}'), + (score_bar(v), color(v)))) stats = [] stats.append(f'n={rep.num_samples}') if wall_s >= 1: @@ -343,12 +350,19 @@ def _print_result_panel(console, rep, wall_s: float = 0.0): body = Table(show_header=False, box=None, padding=(0, 2)) body.add_column('k', style='dim', no_wrap=True) body.add_column('v', overflow='fold') + def score_bar(v, width=22): + # rich-Bar-style glyphs with half-cell precision: ━━━╸╌╌ + filled = max(0.0, min(1.0, v)) * width + full = int(filled) + half = '╸' if filled - full >= 0.5 else '' + return '━' * full + half + '╌' * (width - full - len(half)) + for m, v in metrics: if m == 'extraction_failure_rate': continue - bar = Text('█' * int(round(v * 24)) + '·' * (24 - int(round(v * 24)))) - bar.stylize(color(v)) - body.add_row(m, Text.assemble(f'{v * 100:6.1f}% ', bar)) + body.add_row(m, Text.assemble( + (f'{v * 100:6.1f}% ', f'bold {color(v)}'), + (score_bar(v), color(v)))) stats = [] stats.append(f'n={rep.num_samples}') if wall_s >= 1: