(naive_rate, cl_rate, ax)
| 443 | |
| 444 | |
| 445 | def chart_1_pass_rate(naive_rate, cl_rate, ax): |
| 446 | labels = ["Naive\n(no control layer)", "Control Layer\n(retry + fallback)"] |
| 447 | values = [naive_rate, cl_rate] |
| 448 | colors = [CHART_COLOR_FAIL, CHART_COLOR_PASS] |
| 449 | bars = ax.bar(labels, values, color=colors, width=0.5, edgecolor="white", linewidth=1.5) |
| 450 | for bar, val in zip(bars, values): |
| 451 | ax.text(bar.get_x() + bar.get_width() / 2, bar.get_height() + 1.5, |
| 452 | f"{val:.0f}%", ha="center", va="bottom", fontsize=12, |
| 453 | fontweight="bold", color=CHART_COLOR_DARK) |
| 454 | ax.set_ylim(0, 115) |
| 455 | ax.axhline(100, color=CHART_GRID, linewidth=1, linestyle=":") |
| 456 | _apply_base_style(ax, "Pass Rate: Naive vs Control Layer", "", "Pass Rate (%)") |
| 457 | |
| 458 | |
| 459 | def chart_2_failure_dist(audit, ax): |
no test coverage detected