Skip to content

feat(pygal): implement line-multi#5801

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/line-multi/pygal
May 6, 2026
Merged

feat(pygal): implement line-multi#5801
MarkusNeusinger merged 4 commits into
mainfrom
implementation/line-multi/pygal

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 6, 2026

Implementation: line-multi - python/pygal

Implements the python/pygal version of line-multi.

File: plots/line-multi/implementations/python/pygal.py

Parent Issue: #1825


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 6, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot renders on a warm off-white background (#FAF8F1) as expected. The title "line-multi · pygal · anyplot.ai" appears centered at the top in dark ink, clearly readable. The y-axis label "Sales (thousands USD)" is displayed vertically on the left, and the x-axis label "Month" appears along the bottom — both readable. Tick labels (Jan–Dec on x-axis, numeric values on y-axis) are visible. The legend is positioned in the top-left corner, showing four series (Electronics, Clothing, Home Goods, Sports) with small colored squares. Four lines are drawn in correct Okabe-Ito order: Electronics in #009E73 (green), Clothing in #D55E00 (orange), Home Goods in #0072B2 (blue), Sports in #CC79A7 (pink-purple). Dots are shown at each data point. Horizontal y-guide grid lines are subtle and dotted. All text is dark on light background — legibility verdict: PASS.

Dark render (plot-dark.png): The same chart renders on a warm near-black background (#1A1A17). All chrome elements (title, axis labels, tick labels, legend text) flip to light/off-white text on the dark surface — all clearly readable. The data line colors are identical to the light render: Electronics green (#009E73), Clothing orange, Home Goods blue, Sports pink-purple — confirming only chrome flips, not data colors. Grid lines are subtle dotted lines, subtly lighter on the dark surface. No dark-on-dark failures detected. Legibility verdict: PASS.

Both paragraphs are required. A review that only describes one render is invalid.

Score: 85/100

Category Score Max
Visual Quality 29 30
Design Excellence 9 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 7 10
Total 85 100

Visual Quality (29/30)

  • VQ-01: Text Legibility (8/8) — All font sizes explicitly set to spec: title=28px, labels=22px, ticks=18px, legend=16px — all match the pixel-based guide exactly
  • VQ-02: No Overlap (6/6) — Month labels well-spaced, legend entries clear, no text collisions
  • VQ-03: Element Visibility (6/6) — Dots visible (dots_size=6), lines appropriately thick (stroke_width=3)
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette is CVD-safe; all 4 series distinguishable
  • VQ-05: Layout & Canvas (3/4) — Chart fills ~60–70% of canvas; minor issue: legend in top-left corner floats inside the plot area creating slight visual imbalance
  • VQ-06: Axis Labels & Title (2/2) — "Sales (thousands USD)" with units; "Month" descriptive
  • VQ-07: Palette Compliance (2/2) — First series #009E73 ✓, Okabe-Ito order 1–4 ✓, backgrounds #FAF8F1/#1A1A17 ✓, both themes chrome-correct ✓

Design Excellence (9/20)

  • DE-01: Aesthetic Sophistication (4/8) — Well-configured pygal default with correct Okabe-Ito and theme tokens, but no exceptional design choices, no visual hierarchy, no focal points
  • DE-02: Visual Refinement (3/6) — Non-default choices made: show_x_guides=False, explicit margins (margin=100, margin_top=120), appropriate spacing — above minimal but chart retains full-border pygal frame
  • DE-03: Data Storytelling (2/6) — Four interesting trends displayed (Electronics dominant growth, Sports seasonal arc) but nothing guides the viewer to the story; no emphasis or visual hierarchy

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — pygal.Line() with 4 series, correct multi-line comparison
  • SC-02: Required Features (4/4) — Multiple series, distinct colors, legend, dots at data points, legend labels
  • SC-03: Data Mapping (3/3) — Months on x-axis, sales values on y-axis, all data visible
  • SC-04: Title & Legend (3/3) — "line-multi · pygal · anyplot.ai" ✓; legend labels match series names ✓

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Shows diverse trend types: strong upward (Electronics), moderate growth (Clothing, Home Goods), seasonal arc (Sports)
  • DQ-02: Realistic Context (5/5) — Monthly sales for 4 product lines over a year — realistic, neutral business scenario
  • DQ-03: Appropriate Scale (4/4) — Values 22–110 (thousands USD) plausible for product line monthly sales; Electronics highest, Sports seasonal — factually coherent

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean linear flow: tokens → data → style → chart → add series → save
  • CQ-02: Reproducibility (2/2) — Fully deterministic, hardcoded data lists
  • CQ-03: Clean Imports (2/2) — os, sys, Path, pygal, Style — all used
  • CQ-04: Code Elegance (2/2) — Clean, Pythonic; sys.path manipulation is necessary for import collision avoidance
  • CQ-05: Output & API (1/1) — Saves plot-{THEME}.png + plot-{THEME}.html correctly (pygal interactive library)

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) — Comprehensive idiomatic pygal usage: Style for all theming, x_labels, add(), render_to_png(), render() — above default but not exceptional
  • LM-02: Distinctive Features (3/5) — Saves both PNG and HTML, leveraging pygal's distinctive interactive JS chart output; uses show_y_guides/show_x_guides selectively

Score Caps Applied

  • None — DE-01=4 (>2), so "correct but boring" cap (75) does not apply

Strengths

  • Perfect spec compliance: all required multi-line features present, correct chart type, correct title format
  • Perfect data quality: realistic product sales scenario, diverse trend shapes, plausible values, neutral topic
  • Perfect code quality: clean KISS structure, deterministic data, clean imports
  • Flawless palette and theme compliance: Okabe-Ito order, correct backgrounds, both renders theme-correct
  • Font sizes explicitly set to style guide values for pixel-based libraries

Weaknesses

  • Design excellence is lacking: chart looks like a well-configured default — no focal point, no visual hierarchy guiding the viewer to the key story (Electronics dominant growth, Sports seasonality)
  • No data storytelling: four lines shown but the viewer must find the insight; no emphasis distinguishes the leading/most interesting series
  • Legend floats in top-left corner inside the plot area, creating slight visual imbalance and crowding in the corner

Issues Found

  1. DE-01 LOW (4/8): Solid configuration but no design sophistication above pygal defaults
    • Fix: Add visual emphasis to the most interesting trend (e.g., make Electronics line slightly thicker or add end-of-line labels); use legend_at_bottom=True to clean up the top-left corner; consider more refined label formatting
  2. DE-03 LOW (2/6): Data is displayed but not interpreted — no visual hierarchy
    • Fix: Move legend to bottom (legend_at_bottom=True) to clean layout; increase stroke_width on the dominant series (Electronics) to 4–5 vs. 3 for others; set show_x_guides=False already done — keep; consider reducing dots_size on secondary series for subtle hierarchy
  3. VQ-05 MINOR (3/4): Legend in top-left corner of plot area creates slight visual imbalance
    • Fix: legend_at_bottom=True moves legend below chart giving a cleaner composition

AI Feedback for Next Attempt

Improve design excellence: move legend to bottom (legend_at_bottom=True) to eliminate the top-left visual clutter. Create visual hierarchy by making the Electronics line thicker (stroke_width=4 or 5) than secondary lines (stroke_width=2.5) to guide the viewer to the dominant trend. Consider reducing dots_size on secondary series (Sports, Home Goods) to 4 while keeping Electronics at 7–8. These changes tell the data story (Electronics dominates, Sports is seasonal) without annotations. Data and code are excellent — only design sophistication needs improvement.

Verdict: REJECTED

@github-actions github-actions Bot added quality:85 Quality score 85/100 ai-rejected Quality not OK, triggers update labels May 6, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented May 6, 2026

🔧 Repair Attempt 1/4

Applied fixes based on AI review feedback.

Status: Repair completed, re-triggering review...


🤖 impl-repair

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 6, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): The plot renders on a warm off-white (#FAF8F1) background with 4 smooth lines spanning 12 months (Jan–Dec). Electronics is in brand green (#009E73) trending steeply upward to 110k; Clothing in orange (#D55E00) shows moderate growth to 88k; Home Goods in blue (#0072B2) grows steadily to 72k; Sports in reddish-purple (#CC79A7) shows a seasonal arc peaking in summer (~72k) then dropping to 28k by December. Horizontal y-axis grid lines are present (subtle); x-axis guide lines are off. The legend appears in two columns at the bottom-left. Title, axis labels, and tick labels are all readable against the light background. No light-on-light failures.

Dark render (plot-dark.png): The same chart renders on a near-black (#1A1A17) surface. All four data colors are identical to the light render (green, orange, blue, pink-purple). Title and all axis/tick labels appear in light-colored text against the dark background — clearly readable. Legend text similarly renders light. Horizontal grid lines are visible as subtle white rules. No dark-on-dark failures detected. Chrome correctly flips to light text and chrome while data colors remain unchanged.

Both paragraphs are required. A review that only describes one render is invalid.

Score: 83/100

Category Score Max
Visual Quality 28 30
Design Excellence 8 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 7 10
Total 83 100

Visual Quality (28/30)

  • VQ-01: Text Legibility (7/8) — All font sizes explicitly set (28px title, 22px labels, 18px ticks, 16px legend) matching pixel-based guide; minor deduction as sizes are at minimums and legend reads quite small in practice
  • VQ-02: No Overlap (6/6) — No text overlap; month x-axis labels well-spaced; two-column legend without crowding
  • VQ-03: Element Visibility (6/6) — Lines clearly visible (stroke_width=3), data dots visible (dots_size=6), all 4 series distinguishable
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette CVD-safe; all series have sufficient luminance contrast in both themes
  • VQ-05: Layout & Canvas (3/4) — Good canvas utilization with explicit margins; minor deduction for some wasted space
  • VQ-06: Axis Labels & Title (2/2) — Y: "Sales (thousands USD)" with units; X: "Month"; title format correct
  • VQ-07: Palette Compliance (2/2) — First series #009E73; multi-series follows Okabe-Ito order; backgrounds #FAF8F1/#1A1A17; chrome correctly theme-adaptive

Design Excellence (8/20)

  • DE-01: Aesthetic Sophistication (4/8) — Well-configured pygal with custom style, correct palette, theme-adaptive chrome — professional appearance but essentially a configured default
  • DE-02: Visual Refinement (2/6) — Y-guides only is a correct choice; generous margins; full chart frame/border remains (pygal constraint); grid moderately visible rather than whisper-subtle
  • DE-03: Data Storytelling (2/6) — Data has an interesting story (Electronics growth vs Sports seasonality) but no visual emphasis, hierarchy, or focal point highlights the contrast — data displayed, not interpreted

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct multi-line comparison chart (pygal.Line)
  • SC-02: Required Features (4/4) — Multiple series, distinct colors, legend, data markers (show_dots=True); line style variation is optional per spec
  • SC-03: Data Mapping (3/3) — X=months, Y=sales; all 4 series fully visible across 12 data points
  • SC-04: Title & Legend (3/3) — Title "line-multi · pygal · anyplot.ai"; legend labels match series names

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Diverse trend patterns: upward growth (Electronics), seasonal curve (Sports), moderate growth (Clothing, Home Goods); demonstrates trends, correlations, divergences
  • DQ-02: Realistic Context (5/5) — Monthly sales for 4 retail product lines: neutral, realistic business scenario
  • DQ-03: Appropriate Scale (4/4) — Sales 22–110k USD; Sports summer peak is factually realistic seasonality

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — Clean: imports → theme tokens → data → style → chart → add series → save; no functions/classes
  • CQ-02: Reproducibility (2/2) — All data hardcoded as deterministic lists
  • CQ-03: Clean Imports (2/2) — os, sys, pathlib.Path, pygal, pygal.style.Style — all used
  • CQ-04: Code Elegance (2/2) — Clean Pythonic code; sys.path manipulation necessary for import collision avoidance
  • CQ-05: Output & API (1/1) — Saves plot-{THEME}.png and plot-{THEME}.html; current pygal API

Library Mastery (7/10)

  • LM-01: Idiomatic Usage (4/5) — Idiomatic: Line chart, Style object with all tokens, x_labels, add() for series, render_to_png + render() for HTML
  • LM-02: Distinctive Features (3/5) — HTML interactive output (pygal's distinctive JS interactive feature) generated correctly; custom Style system; smooth spline interpolation

Score Caps Applied

  • None — DE-01=4 > 2, so "correct but boring" cap does not apply; no other cap conditions met

Strengths

  • Full Okabe-Ito palette correctly applied in canonical order — Electronics=#009E73, Clothing=orange, Home Goods=blue, Sports=purple
  • Both light and dark themes render correctly with matching data colors and theme-adaptive chrome
  • Perfect spec compliance: correct multi-line chart type, 4 series with distinct colors, visible markers, legend, correct title format, descriptive axis labels with units
  • Realistic business data with interesting trend variety (Electronics upward growth, Sports seasonality)
  • Correct output: both PNG and HTML generated per-theme, leveraging pygal's interactive HTML feature
  • Clean KISS code structure, deterministic data, all imports used

Weaknesses

  • Design Excellence is generic: no visual emphasis or storytelling — the Sports seasonality vs Electronics growth contrast is not highlighted
  • Legend text (16px) is at the minimum recommended size; two-column bottom legend reads as quite small in practice
  • No line style variation (all solid) — spec recommends this as an additional distinction technique
  • Grid is moderately visible rather than whisper-subtle; chart frame/border unchanged (partial pygal constraint)

Issues Found

  1. DE-03 LOW: Data has a compelling story but no visual hierarchy guides the reader. Electronics dominates with strong upward growth; Sports shows a clear seasonal inverted-V; these could be emphasized through color contrast, line weight variation, or just data arrangement.
    • Fix: Use line opacity variation (primary vs secondary series), or increase stroke width on the most interesting series, or annotate the peak/end values for the contrasting series
  2. DE-02 LOW: Minimal visual refinement beyond defaults — grid is somewhat prominent.
    • Fix: Consider reducing grid prominence if possible via pygal style options; ensure generous whitespace is leveraged

AI Feedback for Next Attempt

The implementation is technically solid and fully compliant. The main gap is Design Excellence — particularly DE-03 (storytelling) and DE-02 (refinement). To score higher: (1) add visual emphasis to the most interesting series, e.g., vary stroke_width so Electronics (the dominant trend) is thicker than others, or add end-point value labels; (2) consider using different line styles if pygal supports stroke-dasharray to differentiate series beyond color alone; (3) increase legend font size above the minimum (20px) so it reads more comfortably at full resolution.

Verdict: APPROVED

@github-actions github-actions Bot added quality:83 Quality score 83/100 ai-approved Quality OK, ready for merge and removed quality:85 Quality score 85/100 labels May 6, 2026
@MarkusNeusinger MarkusNeusinger merged commit 5433fec into main May 6, 2026
@MarkusNeusinger MarkusNeusinger deleted the implementation/line-multi/pygal branch May 6, 2026 21:58
MarkusNeusinger added a commit that referenced this pull request May 6, 2026
…view (#5819)

## Summary

Two minimal resilience patches for the dominant transient failures
observed in the daily-regen audit (2026-05-06):

1. **`impl-review.yml` — \"Extract PR info\" step** (5 failures in 24h).
Wrap `gh pr view` in a 3-attempt retry with exponential backoff. When
the GitHub API blips, the entire review job aborts and the PR ends up
unlabeled — blocking the review → repair → merge cascade. Concretely
caused 4 of the 14 stuck PRs we recovered today (#5696, #5789, #5796,
#5801 had no labels at all because review never made it past step 1).

2. **`impl-generate.yml` — \"Create library metadata file\" step** (6
failures in 24h). Wrap the final `git push origin \"\$BRANCH\"` in a
3-attempt retry that does `fetch + rebase` between attempts. The
dominant failure mode is racing against Claude's earlier push to the
same branch — when the metadata commit hits a non-fast-forward, the
whole generation aborts and the PR never opens.

Both fixes are inline bash retries — no new action dependency. Each step
still hard-fails after 3 attempts so persistent issues still surface (we
don't want to mask real bugs).

## Out of scope (deferred)

- **`daily-regen.yml` \"pick\" job clean exit**: the existing logic
already writes `count=0` when no specs are eligible, and downstream is
gated on `if: needs.pick.outputs.count != '0'`. The 2 reported
\"cancellations\" in the audit period look unrelated to the pick step
itself (likely scheduler-level events).
- **Auto-retry on `ai-review-failed`**: would require a more invasive
`if: failure()` job-level step. Holding until we see whether the
Extract-PR-info retry alone reduces the rate enough.

## Context

This branch is the Stage 5 follow-up to today's recovery work, which
manually shepherded 13 of 14 stuck PRs through the review/repair/merge
pipeline. The full investigation + recovery plan lives at
\`/home/tirao/.claude/plans/bitte-schaue-dir-alle-peppy-bunny.md\`
(local).

## Test plan

- [x] YAML-validate both edited workflows (passes)
- [x] No-op for the happy path: first attempt of each retry preserves
existing behavior exactly
- [ ] CI green on this PR
- [ ] Post-merge: watch the next 24h of impl-generate / impl-review run
conclusions; expect failure rate to drop from ~10% to near 0% on these
two steps

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-approved Quality OK, ready for merge ai-attempt-1 First repair attempt quality:83 Quality score 83/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant