Skip to content

docs: draw the example plots in the qc-core ledger style - #803

Merged
thomaspinder merged 4 commits into
mainfrom
docs/ledger-plot-style
Oct 4, 2026
Merged

thomaspinder merged 4 commits into
mainfrom
docs/ledger-plot-style

Conversation

@thomaspinder

@thomaspinder thomaspinder commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The example notebooks now draw their plots in the QuantClimate "Calibrated Ledger" style from qc-core, as the Impulso docs do. The docs site uses Impulso's oxblood accent scale.

 # every docs/examples/*.py
-from utils import use_mpl_style
 ...
-use_mpl_style()
+gpx.plotting.use_style()

The new public helper picks the style that it can load:

gpjax.plotting.use_style()
  import matplotlib            -> ImportError with an install hint if missing
  if qc_core imports
    qc_core.use_ledger_style()  -> returns "ledger"
  else
    style.use(gpjax/gpjax.mplstyle)  -> returns "gpjax"  (the old docs style, now packaged)
 gpjax/
+├── plotting.py          # use_style()
+└── gpjax.mplstyle       # moved from docs/examples/
 docs/
 ├── conf.py              # accent_color: red -> crimson
 ├── stylesheets/extra.css  # full crimson scale re-toned to oxblood (from impulso)
 └── examples/
-    ├── gpjax.mplstyle
     └── utils.py         # use_mpl_style removed
 pyproject.toml           # docs extra: qc-core>=0.0.4; qc-core exempt from exclude-newer

Notes:

  • qc-core>=0.0.4 is needed: 0.0.1 and 0.0.2 set scatter.edgecolors to a bare hex, which makes every ax.scatter() raise (fixed in QuantClimate/core#2), and 0.0.4 adds the bundled Noto Sans font and a brighter second cycle colour (QuantClimate/core#3).
  • qc-core is exempt from the 7-day exclude-newer cooldown (exclude-newer-package = { qc-core = false }), because it is our own package, published by trusted publishing. All other packages keep the cooldown.
  • A hidden remove-cell in each notebook hides matplotlib's font-fallback log messages (the build host has no Public Sans/Spectral), as Impulso does.
  • Dark-mode accent changes from #d07b76 to the ledger's #cf6f60.

Evidence

  • Before: with qc-core 0.0.1, poe docs-ci failed with 12 warnings. 4 notebooks (classification, constructing_new_kernels, graph_kernels, spatial_linear_gp) raised ValueError: 'faf9f7' is not a valid color value in ax.scatter(), and 16 pages showed findfont messages.
    After: with qc-core 0.0.4 from PyPI, poe docs-ci passes with 0 warnings, and 0 pages show findfont output.
  • tests/test_plotting.py:
    use_style() with qc_core installed   -> "ledger", figure.facecolor == #faf9f7
    use_style() with qc_core blocked     -> "gpjax", prop_cycle == packaged style
    use_style() with matplotlib blocked  -> ImportError("needs Matplotlib")
    packaged style file exists in the wheel
    
  • poe test: 3233 passed, 1 skipped. poe lint and poe docstrings pass. The built wheel contains gpjax/plotting.py and gpjax/gpjax.mplstyle.

Merge Danger

Door: two-way

The docs and CSS changes revert cleanly. gpjax.plotting is a new public module: it is additive, but after a release, removing it would be a breaking change.

Blast Radius: docs

Every example figure changes appearance: new colours, fonts, and the paper background. The 5-colour ledger cycle replaces the 8-colour GPJax cycle (no notebook uses more than 5). Scatter markers change from x to circles, and the default colormap changes from inferno to Matplotlib's default (plots that set cmap explicitly keep it). Site links, hovers, and focus rings change to oxblood tints in both colour modes. Library users are not affected unless they call use_style(); matplotlib and qc-core stay optional.

🤖 Generated with Claude Code

thomaspinder and others added 3 commits October 4, 2026 05:25
use_style applies the qc-core Calibrated Ledger style when qc-core is
installed, and the GPJax Matplotlib style that now ships in the package
when it is not. Matplotlib is imported only inside the function, so it
stays an optional dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every example notebook now calls gpx.plotting.use_style(), replacing the
local use_mpl_style helper and docs/examples/gpjax.mplstyle. The docs
extra needs qc-core>=0.0.3 (the first release with a valid scatter edge
colour), which is exempt from the 7-day exclude-newer cooldown because it
is QuantClimate's own trusted-published package. A hidden cell in each
notebook hides matplotlib's font fallback messages, as impulso does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switch shibuya's accent_color to crimson and re-tone the whole crimson
scale to ledger oxblood, copied from impulso's extra.css. Before, only
--accent-9 was pinned over the Radix red ramp, so washes, borders and
hovers stayed red, and dark mode used #d07b76 instead of the ledger's
#cf6f60.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Continuous Integration dependencies Pull requests that update a dependency file tests examples dev-tools formatting size/l breaking-change labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

📖 Docs preview: https://pr-803--endearing-crepe-c2d5fe.netlify.app

Smoke render — the expensive notebooks run with reduced budgets, so
figures are not publication fidelity. /render-mode.txt says smoke.

qc-core 0.0.4 bundles Noto Sans and moves the second cycle colour to a
brighter blue (QuantClimate/core#3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thomaspinder
thomaspinder merged commit ffae330 into main Oct 4, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change ci Continuous Integration dependencies Pull requests that update a dependency file dev-tools documentation Improvements or additions to documentation examples formatting size/l tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant