specsrbench.figures

One module per paper figure, and the registry the CLI dispatches through.

Each module exposes build(cache=None, outdir=None) -> Path: it draws its figure, prints the numbers the paper quotes from it, and returns the path it wrote. Nothing else in the package imports one figure from another, so a figure can be rebuilt on its own without dragging the rest of the suite in.

These were six Jupyter notebooks until 2026-08-25. Notebooks were a poor fit for a product that has to rebuild identically: their outputs are committed alongside their code, so a stale number can sit in a diff looking like data; they cannot be imported, so five of the six carried a copied load() helper and colour table; and “run all the figures” meant driving nbconvert and parsing stdout to find out whether it had worked.

Module Attributes

REGISTRY

figure name -> (module, output filename).

BY_NUMBER

Paper figure number -> registry name, for specsrbench figures 4.

Functions

build(name[, cache, outdir])

Build one figure by name or number.

build_all([cache, outdir, skip])

Build every figure, in paper order, returning what was written.

resolve(name)

Accept a registry name, a paper figure number, or fig4.

specsrbench.figures.REGISTRY: dict[str, tuple[str, str]] = {'mae': ('fig4_mae_summary', 'fig_mae_summary.pdf'), 'per-line-snr': ('fig5_per_line_snr', 'fig_jades_per_line_snr.pdf'), 'qualitative': ('fig2_qualitative', 'fig_jades_qualitative.pdf'), 'redshift': ('fig6_redshift_mae', 'fig_redshift_mae.pdf'), 'residuals': ('fig3_residual_maps', 'fig_residual_maps.pdf'), 'toy': ('fig1_toy_methods', 'fig_toy_1d.pdf')}

figure name -> (module, output filename). The name is what the CLI takes.

specsrbench.figures.build(name, cache=None, outdir=None)[source]

Build one figure by name or number.

Parameters:
Return type:

Path

specsrbench.figures.build_all(cache=None, outdir=None, skip=())[source]

Build every figure, in paper order, returning what was written.

Parameters:
Return type:

dict[str, Path]