Skip to content

feat(seaborn): implement streamline-basic#6659

Merged
MarkusNeusinger merged 4 commits into
mainfrom
implementation/streamline-basic/seaborn
May 14, 2026
Merged

feat(seaborn): implement streamline-basic#6659
MarkusNeusinger merged 4 commits into
mainfrom
implementation/streamline-basic/seaborn

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Implementation: streamline-basic - python/seaborn

Implements the python/seaborn version of streamline-basic.

File: plots/streamline-basic/implementations/python/seaborn.py

Parent Issue: #2861


🤖 impl-generate workflow

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 14, 2026

AI Review - Attempt 1/3

Image Description

Light render (plot-light.png): The plot displays a vortex flow field with concentric circular streamlines rendered on a warm off-white background (#FAF8F1). The streamlines are colored by flow speed using the viridis colormap, progressing from purple (slower, ~1.0 m/s at center) to yellow (faster, ~2.75 m/s at outer radius). The title "streamline-basic · seaborn · anyplot.ai" is clearly visible at the top in dark text, with axis labels "X Position (m)" and "Y Position (m)" readable at appropriate sizes. Tick labels are visible in soft gray. Small arrowheads on each streamline indicate flow direction (counterclockwise circulation). A colorbar on the right shows the velocity scale with readable label "Flow Speed (m/s)". Subtle y-axis grid lines provide reference without competing with data. All text elements are fully readable against the light background — no legibility issues detected.

Dark render (plot-dark.png): The same visualization on a warm near-black background (#1A1A17) with all chrome (title, axis labels, tick labels, grid) adapted to light gray/off-white for visibility. The viridis colormap data colors are identical to the light render (purple to yellow gradient) — only the background and text colors adapt to theme. Title, axis labels, and tick labels remain clearly visible. Arrowheads and colorbar are equally prominent. Grid lines remain subtle. All text is readable against the dark background with no dark-on-dark failures. Both renders demonstrate proper theme adaptation with chrome colors from INK and INK_SOFT tokens while preserving data color identity.

Score: 87/100

Category Score Max
Visual Quality 30 30
Design Excellence 11 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 6 10
Total 87 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) — All text (title, axis labels, ticks, colorbar) readable at full size in BOTH themes. Dark text on light, light text on dark with proper contrast.
  • VQ-02: No Overlap (6/6) — No collisions between title, axes, legend, colorbar. Clean spatial arrangement.
  • VQ-03: Element Visibility (6/6) — All concentric streamlines clearly distinguishable. Arrowheads visible. Colorbar scale readable. No merging or blur.
  • VQ-04: Color Accessibility (2/2) — Viridis is perceptually uniform and CVD-safe. Adequate contrast throughout.
  • VQ-05: Layout & Canvas (4/4) — Square aspect ratio appropriate. Equal aspect ratio maintained. Margins generous. Nothing cut off.
  • VQ-06: Axis Labels & Title (2/2) — Title properly formatted. Axes descriptive with units (meters, m/s).
  • VQ-07: Palette Compliance (2/2) — Continuous data uses viridis (correct per style guide). Plot backgrounds #FAF8F1 (light) and #1A1A17 (dark). Both renders theme-correct. Data colors identical between themes.

Design Excellence (11/20)

  • DE-01: Aesthetic Sophistication (4/8) — Professional, clean styling. Uses standard viridis colormap (not custom-designed palette). Arrowheads add functional sophistication. Polished but somewhat generic.
  • DE-02: Visual Refinement (3/6) — Top/right spines removed (L-shaped frame) ✓. Y-axis grid subtle and restrained ✓. Whitespace generous ✓. Standard refinement applied well.
  • DE-03: Data Storytelling (4/6) — Viridis gradient creates clear visual hierarchy (slow→fast, center→outer). Concentric pattern clearly shows vortex circulation. Arrowheads guide understanding of flow direction. Good hierarchical storytelling.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) — Correct streamline plot. Vortex field generates expected circular flow patterns. Not a quiver plot — properly uses continuous streamlines.
  • SC-02: Required Features (4/4) — Streamlines as continuous curves ✓. Vector field visualization (u=-y, v=x) ✓. Flow direction shown by arrowheads ✓. Color encodes velocity magnitude ✓. Balanced streamline density across radii ✓.
  • SC-03: Data Mapping (3/3) — X/Y axes correct. Velocity magnitude properly mapped to viridis colormap. Grid bounds (-3.5 to 3.5) show full field structure.
  • SC-04: Title & Legend (3/3) — Title format "streamline-basic · seaborn · anyplot.ai" ✓. Colorbar with label "Flow Speed (m/s)" and numeric scale ✓.

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) — Multiple concentric streamlines show full field topology. Gradient colors show velocity variation. Arrowheads show flow direction. Field structure completely captured.
  • DQ-02: Realistic Context (5/5) — Vortex field is canonical physics example (fluid dynamics, EM fields, gradient descent). Neutral, domain-agnostic. Appropriate for scientific visualization.
  • DQ-03: Appropriate Scale (4/4) — Units sensible (meters, m/s). Grid bounds appropriate for visualizing vortex. Colorbar range (1.0–2.75 m/s) matches generated field. No scale artifacts.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) — No unnecessary functions or classes. Direct numpy/pandas/matplotlib operations. Straightforward Euler integration for streamline tracing.
  • CQ-02: Reproducibility (2/2) — Seed set: ✓. Fixed starting points (radii, angles). Deterministic output guaranteed.
  • CQ-03: Clean Imports (2/2) — All imports used: os (ANYPLOT_THEME), matplotlib (plotting), numpy (vectors), pandas (data structures), seaborn (styling), patches (arrowheads). No dead imports.
  • CQ-04: Code Elegance (2/2) — Appropriate complexity for streamline tracing. No fake UI/interactivity. Clean data structures and logical flow.
  • CQ-05: Output & API (1/1) — Saves as with dpi=300 ✓. Current seaborn API (sns.lineplot, sns.set_theme) ✓.

Library Mastery (6/10)

  • LM-01: Idiomatic Usage (4/5) — Proper seaborn patterns: for configuration, with parameter for grouping streamlines, colormap handling. Clean integration with matplotlib. Idiomatic approach.
  • LM-02: Distinctive Features (2/5) — Uses seaborn's parameter to group by streamline_id (distinctive for multi-series). Standard and colormap application. Limited exploitation of seaborn's unique capabilities.

Score Caps Applied

  • None — all threshold criteria passed.

Strengths

  • Perfect visual legibility in both light and dark themes with no text rendering issues
  • Correct streamline representation of vector field (not discrete quiver arrows)
  • Excellent spec compliance across all four criteria
  • Clean, reproducible code with proper theme adaptation
  • Proper use of perceptually-uniform viridis colormap for continuous velocity data
  • Well-distributed streamline density across field showing complete circulation pattern
  • Clear flow direction indication via arrowheads

Weaknesses

  • Design Excellence only marginally above default — uses standard viridis colormap with minimal custom styling choices
  • Library Mastery could explore more seaborn-specific features beyond basic and

Issues Found

None — implementation meets all requirements and quality standards.

AI Feedback for Next Attempt

This implementation is approved. No fixes required. The streamline plot correctly visualizes the vortex field with proper color encoding, flow direction, and theme adaptation.

Verdict: APPROVED

@github-actions github-actions Bot added quality:87 Quality score 87/100 ai-rejected Quality not OK, triggers update labels May 14, 2026
@github-actions github-actions Bot added ai-attempt-1 First repair attempt and removed ai-rejected Quality not OK, triggers update labels May 14, 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 14, 2026

AI Review - Attempt 2/3

Image Description

Light render (plot-light.png): The plot displays a beautiful vortex field with concentric circular streamlines on a warm off-white background (#FAF8F1). The streamlines are colored with the viridis colormap representing flow speed (0–2.75 m/s), transitioning from purple (slow) at the center through blue, cyan, green, yellow to bright yellow at the outer radius. Small red arrowheads at the midpoint of each streamline clearly indicate the counterclockwise flow direction. The title "streamline-basic · seaborn · anyplot.ai" is rendered in dark text (INK color) at the top in a clear, readable font (24pt). Axis labels "X Position (m)" and "Y Position (m)" are also dark and legible (20pt). Tick labels in medium gray (INK_SOFT) are clearly visible. A vertical colorbar on the right labeled "Flow Speed (m/s)" shows the color scale. The plot has a clean L-shaped frame (top and right spines removed), and subtle horizontal gridlines aid readability. All text and elements are easily readable against the light background.

Dark render (plot-dark.png): The same streamline visualization renders identically in data representation on a warm near-black background (#1A1A17). The viridis-colored streamlines are unchanged—the same purple-to-yellow gradient—confirming that only the chrome (background and text) has flipped. The title, axis labels, and colorbar are now rendered in light text (INK color adjusted to #F0EFE8 for dark theme), which provides excellent contrast against the dark background. Tick labels in a lighter gray (INK_SOFT adjusted for dark theme) are clearly visible. The gridlines remain subtle and visible. All text is readable without any "dark-on-dark" failures; the light text-on-dark-background adaptation is correct. The colorbar label and tick values are properly light-colored, maintaining legibility. Both renders pass the theme-readability check completely.

Score: 86/100

Category Score Max
Visual Quality 30 30
Design Excellence 12 20
Spec Compliance 15 15
Data Quality 15 15
Code Quality 10 10
Library Mastery 4 10
Total 86 100

Visual Quality (30/30)

  • VQ-01: Text Legibility (8/8) - All text (title 24pt, axis labels 20pt, tick labels 16pt) is explicitly sized and fully readable in both light and dark renders. Theme tokens (INK, INK_SOFT) correctly adapt colors between themes.
  • VQ-02: No Overlap (6/6) - Streamlines are concentric and non-overlapping. Arrowheads are distributed at midpoints and cause no collision with labels. Colorbar does not overlap plot area.
  • VQ-03: Element Visibility (6/6) - All streamlines are clearly distinct and visible. Arrowheads are small but clearly show direction. Colorbar is well-proportioned and readable.
  • VQ-04: Color Accessibility (2/2) - Viridis colormap is CVD-safe and perceptually uniform. Colorbar explicitly labels the magnitude scale. No red-green as sole signal.
  • VQ-05: Layout & Canvas (4/4) - Square figsize (12×12) with equal aspect ratio is appropriate for symmetric vortex visualization. Xlim/ylim set to ±3.5 with no cut-off. Good proportions.
  • VQ-06: Axis Labels & Title (2/2) - Title follows spec format "streamline-basic · seaborn · anyplot.ai". X/Y axes labeled with units ("Position (m)").
  • VQ-07: Palette Compliance (2/2) - Viridis used for continuous velocity data (correct). Plot backgrounds match spec (#FAF8F1 light, #1A1A17 dark). Data colors identical between renders, only chrome flips. Both renders theme-correct.

Design Excellence (12/20)

  • DE-01: Aesthetic Sophistication (5/8) - Clean, minimalist design with elegant concentric circles. Viridis colormap is well-chosen but not custom-curated. Arrowheads add clarity and are a nice touch, but overall presentation is solid rather than exceptional. Raises from default (4) to 5 due to thoughtful integration of colorbar and flow direction indicators.
  • DE-02: Visual Refinement (4/6) - Top and right spines removed for clean L-shaped frame. Y-axis grid is subtle (alpha=0.15). Whitespace is generous with tight_layout and bbox_inches='tight'. Professional appearance but standard refinement rather than exceptional polish.
  • DE-03: Data Storytelling (3/6) - The concentric circles naturally create a focal point at the center, and the color gradient guides attention outward. Arrowheads show flow direction, aiding comprehension. However, visual hierarchy is more from data structure than intentional design emphasis. No additional callouts or annotations to enhance narrative.

Spec Compliance (15/15)

  • SC-01: Plot Type (5/5) - Correct streamline plot type showing vector field visualization with smooth curved paths tangent to field.
  • SC-02: Required Features (4/4) - All features present: streamlines (✓), flow direction via arrowheads (✓), velocity magnitude color encoding (✓), field topology visible (vortex pattern) (✓).
  • SC-03: Data Mapping (3/3) - X/Y coordinates correctly mapped. Velocity magnitude mapped to viridis colorbar. All domain data visible within plot area (−3.5 to 3.5).
  • SC-04: Title & Legend (3/3) - Title format matches spec. Colorbar serves as legend for continuous magnitude. No categorical legend needed for single vector field.

Data Quality (15/15)

  • DQ-01: Feature Coverage (6/6) - Demonstrates all aspects of a basic streamline plot: multiple starting positions at different radii, continuous streamline paths, velocity color encoding, directional arrows, appropriate density.
  • DQ-02: Realistic Context (5/5) - Vortex field (u=−y, v=x) is a canonical physics example, mathematically correct and physically plausible. Neutral application (no controversial framing).
  • DQ-03: Appropriate Scale (4/4) - Domain [−3.2, 3.2] with 6 starting radii. Velocity magnitude ranges 0–2.75 m/s (reasonable for synthetic field). Euler integration dt=0.03, max_steps=250 produces smooth, well-distributed streamlines.

Code Quality (10/10)

  • CQ-01: KISS Structure (3/3) - No functions or classes. Straightforward script with data generation → visualization pipeline. Easy to read and understand.
  • CQ-02: Reproducibility (2/2) - np.random.seed(42) ensures deterministic behavior. Produces identical output on every run.
  • CQ-03: Clean Imports (2/2) - Imports are minimal and all used: os, numpy, pandas, seaborn, matplotlib. No unused packages.
  • CQ-04: Code Elegance (2/2) - Euler integration for streamline tracing is appropriate and well-implemented. FancyArrowPatch usage is idiomatic. No fake UI or unnecessary complexity.
  • CQ-05: Output & API (1/1) - Correctly saves as plot-{THEME}.png. Current seaborn API used throughout (sns.lineplot with units parameter, sns.set_theme).

Library Mastery (4/10)

  • LM-01: Idiomatic Usage (3/5) - Uses sns.lineplot() with units parameter to group streamlines and sns.set_theme() for configuration, which is standard seaborn practice. However, the core streamline logic (Euler integration, arrowhead placement) is general matplotlib/numpy, not seaborn-specific. FancyArrowPatch usage is idiomatic but matplotlib-level. Keeps to default (3) as seaborn usage is competent but not exceptional.
  • LM-02: Distinctive Features (1/5) - Does not showcase seaborn-specific capabilities beyond standard lineplot and theming. The visualization technique (streamlines + arrows) is more of a matplotlib/numpy contribution than seaborn. Keeps default (1).

Score Caps Applied

  • None — no criteria triggered score caps. All VQ/SC/DQ passing. CQ-04 ≠ 0. DE not ≤2 + ≤2.

Strengths

  • Perfect theme adaptation: Both light and dark renders have correct backgrounds, text colors, and chrome, with no legibility failures
  • Clean mathematical visualization: Euler-integrated streamlines accurately represent the vortex field; arrowheads clearly indicate direction
  • Professional polish: Minimal spine design, subtle grid, generous whitespace, proper colorbar integration
  • Reproducible and robust: Deterministic seed, clean code structure, no edge cases or failures
  • Perceptually uniform colormap: Viridis is CVD-safe and correctly applied to continuous velocity data

Weaknesses

  • Design is competent but standard: Lacks custom visual refinement beyond defaults; could benefit from intentional color palette choices or additional annotations
  • Limited seaborn-specific usage: Core visualization logic relies on custom Euler integration and matplotlib patches rather than seaborn features
  • No visual hierarchy emphasis: Focal point emerges from data structure, not intentional design decisions (e.g., color contrast, size variation, or annotated insights)

Issues Found

  1. DE-01 & DE-02 MODERATE: Design is functional and clean but generic. While arrowheads and colorbar are well-integrated, there are no custom design choices that elevate the visualization.
    • Fix: Consider adding annotations for key flow features (e.g., "Vortex center", "Outward circulation"), or custom color palette that complements the warm theme backgrounds.
  2. LM-02 LOW: Limited use of seaborn-specific features. The implementation is primarily numpy + matplotlib with seaborn styling.
    • Fix: This is acceptable for a basic streamline plot; seaborn isn't optimized for custom vector field visualizations. However, could explore sns.FacetGrid for multiple field examples if extending the plot.

AI Feedback for Next Attempt

The implementation successfully meets all requirements and passes both theme-adaptation checks. To raise the score above 86, focus on design excellence: add strategic annotations highlighting key field features (e.g., "Circulation at center"), consider custom visual refinement (e.g., thicker outer streamlines to emphasize circulation strength), or incorporate seaborn's theming for more cohesive color palettes. The current version is solid production-ready—further improvements are refinements, not fixes.

Verdict: APPROVED

@github-actions github-actions Bot added quality:86 Quality score 86/100 ai-approved Quality OK, ready for merge and removed quality:87 Quality score 87/100 labels May 14, 2026
@MarkusNeusinger MarkusNeusinger merged commit 06d3379 into main May 14, 2026
6 checks passed
@MarkusNeusinger MarkusNeusinger deleted the implementation/streamline-basic/seaborn branch May 14, 2026 07:26
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:86 Quality score 86/100

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant