MCPcopy Create free account
hub / github.com/Emmimal/control-layer / chart_6_quality_scores

Function chart_6_quality_scores

demo.py:554–571  ·  view source on GitHub ↗
(records, ax)

Source from the content-addressed store, hash-verified

552
553
554def chart_6_quality_scores(records, ax):
555 scores = [r.validation.score for r in records if hasattr(r, "validation")]
556 if not scores:
557 return
558 bins = np.arange(0, 1.1, 0.1)
559 n, _, patches = ax.hist(scores, bins=bins, edgecolor="white",
560 linewidth=1.5, color=CHART_COLOR_PASS)
561 for patch, val in zip(patches, n):
562 if val > 0:
563 ax.text(patch.get_x() + patch.get_width() / 2, val + 0.05,
564 str(int(val)), ha="center", va="bottom",
565 fontsize=8, color=CHART_COLOR_DARK, fontweight="bold")
566 ax.axvline(np.mean(scores), color=CHART_COLOR_FAIL, linewidth=1.5,
567 linestyle="--", label=f"Mean: {np.mean(scores):.2f}")
568 _apply_base_style(ax, "Response Quality Score Distribution",
569 "Quality Score", "Count")
570 ax.set_xlim(0, 1.05)
571 ax.legend(fontsize=8, framealpha=0.9, edgecolor=CHART_GRID)
572
573
574def generate_all_charts(benchmark_results, cl_packets, config):

Callers 1

generate_all_chartsFunction · 0.85

Calls 1

_apply_base_styleFunction · 0.85

Tested by

no test coverage detected