Skip to content

Polish real-world example gallery - #342

Merged
Alek99 merged 1 commit into
mainfrom
codex/cleaner-readme-examples
Jul 27, 2026
Merged

Polish real-world example gallery#342
Alek99 merged 1 commit into
mainfrom
codex/cleaner-readme-examples

Conversation

@carlosabadia

@carlosabadia carlosabadia commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • simplify all six real-world examples by removing embedded titles, descriptions, axes, ticks, and grids where they do not add meaning
  • give each chart a more deliberate palette, clearer annotations, stronger session-zone contrast, and preserved continuous colorbars
  • regenerate every gallery image at 2400x1400 and tighten the NYC crop while preserving geographic proportions and airport context

Validation

  • uv run --with pre-commit pre-commit run --all-files
  • uv run ruff check .
  • uv run ruff format --check .
  • python scripts/verify_local.py --only examples (9 passed, 2 skipped)
  • git diff --check

Closes ENG-10638.

Summary by CodeRabbit

  • Style
    • Refreshed visual themes, color palettes, typography, spacing, and chart backgrounds across six data-visualization examples.
    • Simplified axes by reducing or hiding tick labels, gridlines, and boundary markers for a cleaner presentation.
    • Improved chart annotations, callouts, legends, and session labels for better readability.
  • Visualization Updates
    • Added downsampling and opacity improvements to the Gaia star chart.
    • Added off-scale indicators and capped display ranges to the Pan-UK Biobank Manhattan plot.
    • Updated color scales, guide overlays, waveform styling, map framing, and colorbars across the remaining examples.

@linear-code

linear-code Bot commented Jul 27, 2026

Copy link
Copy Markdown

ENG-10638

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Six real-world visualization notebooks update chart rendering, axis visibility, themes, annotations, color palettes, data display limits, and layout padding. The Pan-UKBB notebook also adds capped Y rendering and off-scale peak labels.

Changes

Real-world notebook visualization refresh

Layer / File(s) Summary
Gaia HR diagram rendering
examples/real_world/01_gaia_hr_diagram.ipynb
Scatter points are downsampled and rendered with revised callouts, axes, theme colors, and padding.
gNOMAD chart presentation
examples/real_world/02_gnomad_allele_frequency.ipynb
Axis labels and chromosome boundary lines are removed, while theme settings and padding are updated.
Pan-UKBB Manhattan plot limits
examples/real_world/03_pan_ukbb_manhattan.ipynb
Y values are capped for display, off-scale peaks receive labels, and annotations, axes, colors, theme, font, and padding are revised.
Dukascopy session presentation
examples/real_world/04_dukascopy_fx_ticks.ipynb
Session bands and annotations are restyled, session boundary lines are removed, and axes, theme, and layout are updated.
LIGO waveform chart styling
examples/real_world/05_ligo_gw150914_strain.ipynb
Overview, bandpassed, and reconstructed charts receive updated axis styles, trace colors, annotations, themes, and padding.
NYC taxi density presentation
examples/real_world/06_nyc_taxi_density.ipynb
Chart framing and axes are simplified, headers and borders are removed, and colorbar, colormap, and padding settings change.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • reflex-dev/xy#296: Adds the same six real-world notebooks whose chart configurations are updated here.

Suggested reviewers: alek99

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s broad goal of polishing the real-world example gallery.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/cleaner-readme-examples

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jul 27, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 103 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing codex/cleaner-readme-examples (283a80c) with main (a2ac10e)

Open in CodSpeed

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
examples/real_world/03_pan_ukbb_manhattan.ipynb (1)

182-200: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Mismatched thresholds between peak clamp and OFF-SCALE label.

peak_display_y clamps to off_scale_y (172) but the "OFF-SCALE" suffix only triggers when the raw value exceeds display_y_max (180). A peak whose true value falls between 172 and 180 gets silently pinned to y=172 (visually displaced from its real position) with no annotation explaining the discrepancy, since 172 < value ≤ 180 doesn't satisfy value > display_y_max.

🐛 Proposed fix: align clamp/suffix thresholds
-    value = float(neglog10_pvalue[peak_index])\n",
-    suffix = " · OFF-SCALE" if value > display_y_max else ""\n",
+    value = float(neglog10_pvalue[peak_index])\n",
+    suffix = " · OFF-SCALE" if value > off_scale_y else ""\n",
     peak_labels.append(\n",
         f"CHR {chromosome} · {position / 1e6:.1f} MB · −LOG₁₀(P) {value:.1f}{suffix}"  # noqa: RUF001\n",
     )\n",
-peak_display_y = np.minimum(\n",
-    neglog10_pvalue[[chr20_peak_index, other_peak_index]],\n",
-    off_scale_y,\n",
-)\n",
+raw_peak_y = neglog10_pvalue[[chr20_peak_index, other_peak_index]]\n",
+peak_display_y = np.where(raw_peak_y > off_scale_y, off_scale_y, raw_peak_y)\n",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@examples/real_world/03_pan_ukbb_manhattan.ipynb` around lines 182 - 200,
Align the OFF-SCALE suffix condition in the peak_labels loop with the
peak_display_y clamp by using off_scale_y as the threshold instead of
display_y_max. Preserve the existing label formatting and ensure every peak
whose value exceeds the clamp threshold is marked as OFF-SCALE.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@examples/real_world/03_pan_ukbb_manhattan.ipynb`:
- Around line 182-200: Align the OFF-SCALE suffix condition in the peak_labels
loop with the peak_display_y clamp by using off_scale_y as the threshold instead
of display_y_max. Preserve the existing label formatting and ensure every peak
whose value exceeds the clamp threshold is marked as OFF-SCALE.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 681f063d-4bc2-41a2-aa78-d9d8d654c8f2

📥 Commits

Reviewing files that changed from the base of the PR and between a2ac10e and 283a80c.

⛔ Files ignored due to path filters (6)
  • examples/real_world/assets/01-gaia-hr-diagram.png is excluded by !**/*.png
  • examples/real_world/assets/02-gnomad-allele-frequency.png is excluded by !**/*.png
  • examples/real_world/assets/03-pan-ukbb-manhattan.png is excluded by !**/*.png
  • examples/real_world/assets/04-dukascopy-fx-ticks.png is excluded by !**/*.png
  • examples/real_world/assets/05-ligo-gw150914-strain.png is excluded by !**/*.png
  • examples/real_world/assets/06-nyc-taxi-density.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • examples/real_world/01_gaia_hr_diagram.ipynb
  • examples/real_world/02_gnomad_allele_frequency.ipynb
  • examples/real_world/03_pan_ukbb_manhattan.ipynb
  • examples/real_world/04_dukascopy_fx_ticks.ipynb
  • examples/real_world/05_ligo_gw150914_strain.ipynb
  • examples/real_world/06_nyc_taxi_density.ipynb

@Alek99
Alek99 merged commit c1233a3 into main Jul 27, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants