Score bars: rich-style half-cell glyphs (━━━╸╌╌) replacing block chars
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5c3d622f41
commit
075e8728cb
@ -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 = Table(show_header=False, box=None, padding=(0, 2))
|
||||||
body.add_column('k', style='dim', no_wrap=True)
|
body.add_column('k', style='dim', no_wrap=True)
|
||||||
body.add_column('v', overflow='fold')
|
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:
|
for m, v in metrics:
|
||||||
if m == 'extraction_failure_rate':
|
if m == 'extraction_failure_rate':
|
||||||
continue
|
continue
|
||||||
bar = Text('█' * int(round(v * 24)) + '·' * (24 - int(round(v * 24))))
|
body.add_row(m, Text.assemble(
|
||||||
bar.stylize(color(v))
|
(f'{v * 100:6.1f}% ', f'bold {color(v)}'),
|
||||||
body.add_row(m, Text.assemble(f'{v * 100:6.1f}% ', bar))
|
(score_bar(v), color(v))))
|
||||||
stats = []
|
stats = []
|
||||||
stats.append(f'n={rep.num_samples}')
|
stats.append(f'n={rep.num_samples}')
|
||||||
if wall_s >= 1:
|
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 = Table(show_header=False, box=None, padding=(0, 2))
|
||||||
body.add_column('k', style='dim', no_wrap=True)
|
body.add_column('k', style='dim', no_wrap=True)
|
||||||
body.add_column('v', overflow='fold')
|
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:
|
for m, v in metrics:
|
||||||
if m == 'extraction_failure_rate':
|
if m == 'extraction_failure_rate':
|
||||||
continue
|
continue
|
||||||
bar = Text('█' * int(round(v * 24)) + '·' * (24 - int(round(v * 24))))
|
body.add_row(m, Text.assemble(
|
||||||
bar.stylize(color(v))
|
(f'{v * 100:6.1f}% ', f'bold {color(v)}'),
|
||||||
body.add_row(m, Text.assemble(f'{v * 100:6.1f}% ', bar))
|
(score_bar(v), color(v))))
|
||||||
stats = []
|
stats = []
|
||||||
stats.append(f'n={rep.num_samples}')
|
stats.append(f'n={rep.num_samples}')
|
||||||
if wall_s >= 1:
|
if wall_s >= 1:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user