Repository navigation
Description
Motivation
The analysis/plotting experience currently has no in-memory result object. The boundary between "GPEC ran" and "I want to look at the output" is a bag of hardcoded HDF5 string paths — each of the ~30 plot_* functions in src/Analysis/ re-opens the h5 and reaches for its own paths (e.g. perturbed_equilibrium/singular_coupling/resonant_area_weighted_field).
That single missing abstraction produces most of our UX pain:
- Discovery — you must read the docs to learn which plots exist and what they mean, because nothing in memory can tell you.
- Preconditions — there is no shared notion of "which stages ran". Functions check ad-hoc (e.g.
_has_pe_datainsrc/Analysis/PerturbedEquilibrium.jlreturns a placeholder plot titled "run with perturbed equilibrium enabled"), which is inconsistent and easy to forget.
This issue is the keystone of a small Analysis/UX foundation effort (see related issues). Fixing the abstraction removes the need for a heavyweight GUI.
Proposed design
Introduce a lazy GPECResult type wrapping a gpec.h5 (returned from main() and/or via GPEC.load("gpec.h5")) that:
- Knows which stages ran by inspecting the h5 groups (
equil/,vacuum/,locstab//integration/,perturbed_equilibrium/, ...). Exposestages(result)/result.available. - Backs a plot registry. Each
plot_*declares its required stage/dataset(s). Thenplots(result)returns a catalog: plot name, one-line description, and ✓/✗ availability with the reason it is unavailable. - Exposes typed accessors so user code and plot functions stop hardcoding h5 path strings.
- Has a good
show(io, ::GPECResult)printing a summary: stages run, key scalars (q95, β_N, # singular surfaces,Re(et[1]), ...), and "N plots available, M unavailable (need X)".
Target experience
result = GPEC.load("gpec.h5")
result # show() summary: stages, key scalars, plot availability
plots(result) # catalog with ✓/✗ + reason
result.singular.island_widths # typed accessor, no h5 strings
plot(result, :island_widths) # unavailable -> clear, actionable error (see below)Precondition errors, not placeholder plots
Replace the current placeholder-plot pattern with a thrown, actionable error. An empty plot titled "no data" is worse than an exception — the user doesn't learn why or what to change. Example message:
plot_island_widthsrequires the PerturbedEquilibrium stage; this run setforce_termination=true. Enable[PerturbedEquilibrium]and re-run.
Scope / suggested first slice
- Add the
GPECResulttype,stages(),plots()catalog, and the precondition registry. - Wire a handful of existing
plot_*functions (e.g. one from each Analysis submodule) into the registry as a proof of concept, rather than converting all 30 at once. - Follow-up: migrate the remaining plot functions.
Related
- Plot smoke tests in CI (staleness) — Analysis UX: smoke-test every plot in CI to prevent staleness #327
- Self-describing h5 +
describe()(browsing) — Analysis UX: make gpec.h5 self-describing (units/description attrs + describe()) #328
These three together are the real fix; the "do we need a GUI?" question largely answers itself once this object exists (a thin Pluto dashboard becomes plots(result) + a dropdown).
Activity
logan-nc commentedon Nov 2, 2026
Moving to v2.1.0. We're closing out v2.0 tonight for Matt's release pass tomorrow, and a new public API surface shouldn't land on deadline night without design review. Nothing here blocks v2.0: the existing
Analysisplotting entry points ship as they are.matt-pharr commentedon Nov 2, 2026
Yes this is fine @logan-nc. I think this design is a little bit stale as well but still a good idea. This can be an early 2.1.0 pr.
matt-pharr commentedon Nov 4, 2026
Superseded in shape by #649 and #650. After v2.0.0's typed stage results, a wrapper type would duplicate them, so:
available_plots(r)lists the plots for a result, agpec.h5path, or the named tuplemainreturns, with ✓/✗ and the reason (Analysis - FEATURE! - Plot from a result or a gpec.h5 path and list the available plots #650).ArgumentErrorsaying what to change in the run, replacing the "No … data" placeholder plots (Analysis - FEATURE! - Plot from a result or a gpec.h5 path and list the available plots #650).show: every result prints a short REPL summary with its key scalars andPlots k of n available(Display - FEATURE - Give every result type a concise REPL summary #649, Analysis - FEATURE! - Plot from a result or a gpec.h5 path and list the available plots #650).Not adopted: the
GPECResult/GPEC.loadwrapper andplot(result, :name). The catalog names the real functions instead. #650 closes this issue when it merges.