Skip to content

feat(makie): implement skewt-logp-atmospheric#7615

Merged
MarkusNeusinger merged 5 commits into
mainfrom
implementation/skewt-logp-atmospheric/makie
May 22, 2026
Merged

feat(makie): implement skewt-logp-atmospheric#7615
MarkusNeusinger merged 5 commits into
mainfrom
implementation/skewt-logp-atmospheric/makie

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: skewt-logp-atmospheric - julia/makie

Implements the julia/makie version of skewt-logp-atmospheric.

File: plots/skewt-logp-atmospheric/implementations/julia/makie.jl

Parent Issue: #3802


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 22, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): Background is warm off-white (#FAF8F1) — correct, not pure white. Title "skewt-logp-atmospheric · julia · makie · anyplot.ai" fully visible in dark ink at top center (~75% width, expected for the long mandated title). Y-axis label "Pressure (hPa)" and X-axis label "Temperature (°C)" clearly readable. Tick labels (1000/925/850/700/500/400/300/200/100 hPa; -40°/…/40°) visible in INK_SOFT. Reference lines form a subtle diagonal background: gray isotherms (α=0.28), dashed orange-brown dry adiabats (α=0.40), dash-dot blue moist adiabats (α=0.42), dotted green mixing ratio lines (α=0.48). Temperature sounding (#009E73 solid, linewidth 3.5) and dewpoint sounding (#D55E00 dashed, linewidth 3.5) stand out clearly. Legend in top-right with elevated off-white background. All text is readable against the light background.

Dark render (plot-dark.png): Background is warm near-black (#1A1A17) — correct, not pure black. Title, axis labels, and tick labels rendered in light INK (#F0EFE8) / INK_SOFT (#B8B7B0) — all fully readable against the dark surface. No dark-on-dark failures. Legend uses ELEVATED_BG (#242420) with light label text. Reference line colors adjusted slightly for dark theme (higher RGB base, lower alpha). Data colors — Temperature #009E73 and Dewpoint #D55E00 — are identical to the light render; only chrome flips. All text is readable against the dark background.

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

Score: 89/100

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

Visual Quality (29/30)

  • VQ-01: Text Legibility (7/8) — All major font sizes explicitly set (titlesize=20, xlabelsize=14, ylabelsize=14, legend 12, annotations 8–9pt), but xticklabelsize and yticklabelsize are not explicitly set — they inherit figure fontsize=14, making tick labels the same size as axis labels (both 14pt) rather than the recommended smaller 12pt. Minor hierarchy issue.
  • VQ-02: No Overlap (6/6) — No overlapping text or data elements; semi-transparent reference lines stay in the background; small isotherm and mixing ratio labels placed without collision.
  • VQ-03: Element Visibility (6/6) — Data profiles (linewidth 3.5, markersize 7) stand out prominently against subtle reference lines (linewidth 0.7–0.8, alpha 0.28–0.48). Well adapted to data density.
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette; reference line types distinguished by both color AND linestyle (solid/dashed/dashdot/dotted) providing redundant encoding.
  • VQ-05: Layout & Canvas (4/4) — Chart fills 70%+ of 3200×1800 canvas; balanced margins; pressure axis spans full 1000–100 hPa range. Canvas gate passed.
  • VQ-06: Axis Labels & Title (2/2) — "Temperature (°C)" and "Pressure (hPa)" — both descriptive with units.
  • VQ-07: Palette Compliance (2/2) — Temperature = OKABE_ITO[1] = #009E73 ✓; Dewpoint = OKABE_ITO[2] = #D55E00 ✓; backgrounds #FAF8F1/#1A1A17 correct; data colors identical across themes.

Design Excellence (13/20)

  • DE-01: Aesthetic Sophistication (5/8) — Above average: carefully tuned alpha values per reference line type, theme-specific color adjustments, intentional visual hierarchy between background reference system and foreground sounding profiles. Not yet FiveThirtyEight-level — no CAPE shading or altitude-encoded coloring that would push this higher.
  • DE-02: Visual Refinement (4/6) — Good: standard grid replaced with custom isobar lines at 0.08 alpha, top/right spines removed, all alpha values explicitly calibrated per theme, elevated legend background. Whitespace is generous.
  • DE-03: Data Storytelling (4/6) — Visual hierarchy clearly exists (subtle reference background, prominent data foreground). Tropical convective sounding creates a meaningful meteorological narrative. Missing CAPE/CIN region shading or lifted parcel trace that would make atmospheric stability immediately apparent without expert meteorological knowledge.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct Skew-T Log-P diagram: logarithmic pressure Y-axis inverted (1000 hPa at bottom), skewed isotherms at 45 degrees, all required reference line types present.
  • SC-02: Required Features (4/4) — Pressure log axis, skewed isotherms, dry adiabats, moist adiabats, mixing ratio lines, temperature profile (solid), dewpoint profile (dashed). Wind barbs optional per spec and not included — acceptable.
  • SC-03: Data Mapping (3/3) — Skewed X coordinate correctly applied, Y shows log₁₀(P) with hPa string labels, all data visible 1000–100 hPa.
  • SC-04: Title & Legend (3/3) — Title "skewt-logp-atmospheric · julia · makie · anyplot.ai" matches required format. Legend entries "Dry adiabat", "Moist adiabat", "Mixing ratio", "Temperature", "Dewpoint" — all descriptive and correct.

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — 20 pressure levels (1000–100 hPa), all reference line types, both temperature and dewpoint profiles across the full troposphere.
  • DQ-02: Realistic Context (5/5) — Tropical convective radiosonde sounding: real-world meteorological scenario, neutral scientific domain.
  • DQ-03: Appropriate Scale (4/4) — Surface 28.4°C, stratospheric -72.6°C — meteorologically accurate for tropical sounding. Bolton (1980) thermodynamic formulas applied correctly. Dewpoint depression increases realistically with altitude.

Code Quality (9/10)

  • CQ-01: KISS Structure (2/3) — 4 domain-specific helper functions defined (isotherm_line, dry_adiabat_line, mixing_ratio_line, moist_adiabat_line) plus 2 coordinate helpers (skew_x, y_p). Breaks the flat-script convention; justified by thermodynamic complexity but still a deduction.
  • CQ-02: Reproducibility (2/2) — Random.seed!(42) set; sounding data is hardcoded constants, fully deterministic.
  • CQ-03: Clean Imports (2/2) — CairoMakie, Colors, Random — all used, none superfluous.
  • CQ-04: Code Elegance (2/2) — Well-structured thermodynamic code, consistent const naming, no over-engineering, no fake functionality.
  • CQ-05: Output & API (1/1) — save("plot-$(THEME).png", fig; px_per_unit=2) — correct format and current API.

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (5/5) — Correct use of lines!, scatter!, hlines!, text!, axislegend; RGBAf for transparent token-derived colors; ax.yticks tuple assignment for custom log-pressure labels; Makie attribute API used consistently.
  • LM-02: Distinctive Features (3/5) — Custom tick label mapping (log₁₀ pressure → hPa strings), RGBAf construction from INK tokens, axislegend with elevated background. Missing a distinctly Makie-exclusive feature — e.g., a @recipe macro for the Skew-T coordinate system, Observable-driven parameters, or a Colorbar with colormap-encoded sounding profile by altitude.

Score Caps Applied

  • None — no caps triggered (DE-01=5 > 2, CQ-04=2 > 0, all other cap conditions clear).

Strengths

  • Flawless implementation of all Skew-T thermodynamic reference lines (isotherms, dry/moist adiabats, mixing ratio) with correct Bolton-1980 formulas
  • Accurate 45-degree skewed coordinate transform applied consistently; correct log-pressure Y-axis inversion
  • Perfect spec compliance and data quality: realistic tropical convective sounding with meteorologically accurate values
  • Full theme-adaptive chrome (correct backgrounds, INK/INK_SOFT tokens, per-theme alpha adjustments for reference lines)

Weaknesses

  • Missing explicit xticklabelsize and yticklabelsize — tick labels inherit fontsize=14, same as axis labels, reducing typographic hierarchy
  • Helper functions break KISS flat-script convention (justified for thermodynamic complexity but still a structural deviation)
  • Design Excellence ceiling: no CAPE/CIN shading between lifted parcel trace and environmental temperature — this would make atmospheric stability immediately readable and substantially elevate storytelling
  • LM-02: no distinctively Makie-exclusive feature used (e.g., @recipe for custom coordinate system, Observable, or colormap-encoded altitude coloring)

Issues Found

  1. VQ-01 MINOR: xticklabelsize and yticklabelsize not explicitly set — tick labels same size as axis labels at 14pt
    • Fix: Add xticklabelsize = 12, yticklabelsize = 12 to the Axis constructor to restore typographic hierarchy
  2. DE-01/DE-03 MODERATE: No CAPE shading or lifted parcel trace
    • Fix: Compute the lifted parcel path starting from surface (T=28.4°C, Td=24.8°C), lift dry-adiabatically to LCL then moist-adiabatically; shade the CAPE region (area where parcel temperature > environment) in a warm, semi-transparent fill (e.g., poly! with OKABE_ITO[5] at α=0.15)
  3. CQ-01 MINOR: 6 helper functions defined at top level
    • Fix: For a strictly KISS structure, inline the coordinate transforms or consolidate into a single skewt_coords function. (Low priority — complexity justifies helpers here)

AI Feedback for Next Attempt

Improve design excellence: (1) Add xticklabelsize = 12, yticklabelsize = 12 to restore tick/label size hierarchy. (2) Compute the lifted parcel path from the surface level (Bolton 1980 moist adiabat from LCL upward) and shade the CAPE region between the parcel trace and the environmental temperature with a semi-transparent warm fill — this is the single change with the highest meteorological storytelling impact. (3) Optionally, color the temperature and dewpoint sounding lines by pressure level using a viridis colormap (low pressure = brighter) to add visual depth while maintaining profile identity.

Verdict: REJECTED

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

🔧 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 22, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): The plot renders on a warm off-white (#FAF8F1) background. The title "skewt-logp-atmospheric · julia · makie · anyplot.ai" is clearly displayed in dark ink at the top. The Y-axis (Pressure in hPa) runs from 1000 hPa at the bottom to 100 hPa at the top with a logarithmic scale and clearly labeled tick marks (1000, 925, 850, 700, 500, 400, 300, 200, 100). The X-axis shows Temperature (°C) from -40° to 40° with skewed-coordinate isotherms visible as faint diagonal gray lines. The temperature profile is a prominent green solid line (#009E73), and the dewpoint profile is a prominent orange dashed line (#D55E00). Background reference lines are rendered at low alpha: isotherms (faint gray), dry adiabats (faint orange-dashed), moist adiabats (faint blue dash-dot), and mixing ratio lines (faint green dotted). A lifted parcel trace (reddish-purple dashdotdot) and a subtle orange CAPE fill region are present. The LCL diamond marker is visible near 800 hPa with a small "LCL" label. The legend in the top-right corner lists all 7 series. All text is readable against the light background.

Dark render (plot-dark.png): The plot renders on a near-black (#1A1A17) background. Chrome elements (title, axis labels, tick labels, legend text, spine lines) adapt correctly to light-colored tokens. Data colors are identical to the light render — green temperature line, orange dashed dewpoint line, and reddish-purple lifted parcel trace at the same hex values. The elevated legend box uses the dark ELEVATED_BG (#242420). No dark-on-dark failures detected — all axis labels, tick labels, and title are visible against the dark background. Grid-style isobar lines are faint but present. Both renders pass the legibility check.

Score: 85/100

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

Visual Quality (24/30)

  • VQ-01: Text Legibility (6/8) — Title, axis labels, tick labels all readable in both themes. Minor deduction: isotherm labels (fontsize=9) and mixing ratio labels (fontsize=8) are very small and will be hard to read at mobile-scaled sizes (~400 px wide)
  • VQ-02: No Overlap (5/6) — No significant overlap; small annotation labels (LCL, mixing ratio values, isotherm numbers) are placed carefully
  • VQ-03: Element Visibility (4/6) — Main profiles (temperature, dewpoint) are clearly visible. The CAPE fill (alpha=0.22, orange) is very subtle and nearly invisible on the light background. Lifted parcel trace (linewidth=2.0) is thinner than main profiles and may be hard to distinguish from reference lines in busy regions
  • VQ-04: Color Accessibility (2/2) — Okabe-Ito palette is CVD-safe; green/orange combination provides good contrast
  • VQ-05: Layout & Canvas (3/4) — Canvas is 3200×1800 (confirmed by canvas gate pass). Good proportions overall; legend is slightly small and dense with 7 entries
  • VQ-06: Axis Labels & Title (2/2) — "Temperature (°C)" and "Pressure (hPa)" with units; title matches required format
  • VQ-07: Palette Compliance (2/2) — First series (Temperature) = #009E73 ✅; Dewpoint = #D55E00 ✅; backgrounds #FAF8F1 light / #1A1A17 dark ✅; chrome adapts correctly between themes ✅

Design Excellence (14/20)

  • DE-01: Aesthetic Sophistication (6/8) — Impressive thermodynamic implementation with mathematically correct coordinate transforms. Intentional alpha transparency hierarchy (reference lines subdued, profiles prominent). Professional scientific chart aesthetics
  • DE-02: Visual Refinement (4/6) — Top/right spines removed. isobar lines replace grid in a domain-appropriate way. Multiple linestyles (solid, dashed, dashdot, dotted) create clear visual hierarchy among reference line types
  • DE-03: Data Storytelling (4/6) — Temperature profile as focal point in brand green creates clear visual hierarchy. CAPE region adds meteorological interpretation. LCL marker annotates a key derived quantity. Lifted parcel trace enables instability assessment

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct Skew-T Log-P diagram with logarithmic inverted pressure axis and 45-degree skewed isotherms
  • SC-02: Required Features (4/4) — Dry adiabats, moist adiabats, mixing ratio lines, temperature profile (solid), dewpoint (dashed), CAPE region, lifted parcel, LCL marker all present; wind barbs omitted (spec marks as optional)
  • SC-03: Data Mapping (3/3) — Pressure logarithmic and inverted; temperature coordinate correctly skewed; data at meteorologically correct levels
  • SC-04: Title & Legend (3/3) — Title "skewt-logp-atmospheric · julia · makie · anyplot.ai" correct; legend labels all series

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — All major Skew-T features represented: temperature/dewpoint profiles, all three reference line types, CAPE, lifted parcel, LCL
  • DQ-02: Realistic Context (5/5) — Tropical convective sounding data is physically plausible (28.4°C surface, realistic lapse rate through troposphere, surface dewpoint depression of ~3.6°C)
  • DQ-03: Appropriate Scale (4/4) — Pressure 100–1000 hPa; temperature -72°C to +28°C — appropriate for a complete tropospheric sounding

Code Quality (9/10)

  • CQ-01: KISS Structure (2/3) — Helper functions (isotherm_line, dry_adiabat_line, mixing_ratio_line, moist_adiabat_line, lifted_parcel_temps) are genuinely necessary for the thermodynamic calculations; no gratuitous abstraction
  • CQ-02: Reproducibility (2/2) — Random.seed!(42); sounding data is hardcoded constants — fully deterministic
  • CQ-03: Clean Imports (2/2) — CairoMakie, Colors, Random all used
  • CQ-04: Code Elegance (2/2) — Well-organized with clear section comments; no fake UI; correct use of NaN for missing mixing ratio values
  • CQ-05: Output & API (1/1) — save("plot-$(THEME).png", fig; px_per_unit = 2) ✅; uses modern Makie size= API (0.22.x)

Library Mastery (8/10)

  • LM-01: Idiomatic Usage (4/5) — Correct CairoMakie primitives (lines!, scatter!, poly!, hlines!, text!, axislegend). RGBAf for alpha colors. Point2f for polygon vertices. Modern size= parameter
  • LM-02: Distinctive Features (4/5) — poly! for CAPE polygon fill (Makie's native polygon primitive, noted in comments). Custom y-axis tick transformation via log10 mapping. axislegend with styled frame. Diamond scatter marker for LCL

Score Caps Applied

  • None

Strengths

  • Mathematically correct Skew-T coordinate transformation (45° skew + log10 pressure y-axis) implemented from first principles
  • Complete feature set: dry adiabats, moist adiabats, mixing ratio lines, CAPE region, lifted parcel trace, LCL marker — all from thermodynamic equations
  • Theme adaptation is flawless: all 6 chrome tokens (PAGE_BG, ELEVATED_BG, INK, INK_SOFT, isobar_col, reference line colors) flip correctly between light and dark; data colors stay identical
  • First series (Temperature) correctly uses Okabe-Ito brand green #009E73; Dewpoint uses position 2 (#D55E00)
  • Reference lines are intentionally alpha-blended to stay subordinate to the main data profiles — appropriate visual hierarchy for a complex scientific diagram
  • Uses poly! with Point2f polygon construction for CAPE area — idiomatic Makie for filled region

Weaknesses

  • CAPE fill uses alpha=0.22 with OKABE_ITO[5] (#E69F00 orange) — on the warm off-white light background this is nearly invisible; increase alpha to 0.40–0.50 so the CAPE region is clearly distinguishable from the background
  • Isotherm axis labels use fontsize=9 and mixing ratio labels use fontsize=8 — too small to read when chart is scaled to ~400 px mobile width; increase both to fontsize=10
  • Lifted parcel trace uses linewidth=2.0 which is noticeably thinner than the main profiles (3.5) — increase to 2.5 for better visibility in regions where it runs close to the environment temperature line

Issues Found

  1. VQ-03 LOW: CAPE fill alpha=0.22 is near-invisible on light background
    • Fix: Increase poly! CAPE fill alpha to 0.40–0.45 (e.g., RGBAf(OKABE_ITO[5].r, OKABE_ITO[5].g, OKABE_ITO[5].b, 0.42f0))
  2. VQ-01 MINOR: Annotation fontsizes too small for mobile readability
    • Fix: Isotherm text fontsize 9→10; mixing ratio text fontsize 8→10

AI Feedback for Next Attempt

Good implementation overall. The main issues are: (1) CAPE fill is too transparent — increase alpha from 0.22 to 0.42 so it's clearly visible on the light background. (2) Small annotation labels (isotherms at fontsize=9, mixing ratios at fontsize=8) should be bumped to fontsize=10 for mobile readability. (3) Lifted parcel linewidth=2.0 should increase to 2.5. No structural changes needed.

Verdict: APPROVED

@github-actions github-actions Bot added quality:85 Quality score 85/100 ai-approved Quality OK, ready for merge and removed quality:89 Quality score 89/100 labels May 22, 2026
@MarkusNeusinger MarkusNeusinger merged commit e4a69c6 into main May 22, 2026
3 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/skewt-logp-atmospheric/makie branch May 22, 2026 22:27
MarkusNeusinger added a commit that referenced this pull request May 23, 2026
…erge (#7616)

## Summary

- When impl-generate fails (e.g. environment setup error), it tags the
parent issue with `impl:LIB:failed`.
- A subsequent successful retry merges via impl-merge.yml, but only
removed `:pending` — leaving the stale `:failed` label.
- Add `--remove-label "impl:${LIBRARY}:failed"` to the canonical
merge-time label sweep.

## Observed on #3802 (skewt-logp-atmospheric/makie)

First impl-generate attempt failed during *Setup Julia + Makie*
(Project.toml declared the repo as a Julia package). PR #7614 fixed
Project.toml; retry succeeded and PR #7615 merged via impl-merge.yml —
but the issue closed with both `impl:makie:done` and `impl:makie:failed`
for the same library. The stale label has been cleaned up on #3802
manually.

## Why this matters even though counts didn't break

The close-issue counting in impl-merge.yml uses `if/elif`, so `:done`
wins and totals stayed correct here. But the labels themselves are a
contract other readers consume — `sync_to_postgres.py`, the UI, future
workflows. Better to keep the source of truth honest.

## Test plan

- [ ] CI passes
- [ ] Next impl-generate retry-after-failure run produces an issue with
only `:done`, no stale `:failed`

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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:85 Quality score 85/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant