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_data in src/Analysis/PerturbedEquilibrium.jl returns 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/, ...). Expose stages(result) / result.available.
- Backs a plot registry. Each
plot_* declares its required stage/dataset(s). Then plots(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_widths requires the PerturbedEquilibrium stage; this run set force_termination=true. Enable [PerturbedEquilibrium] and re-run.
Scope / suggested first slice
- Add the
GPECResult type, 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
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).
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 insrc/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:
_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
GPECResulttype wrapping agpec.h5(returned frommain()and/or viaGPEC.load("gpec.h5")) that:equil/,vacuum/,locstab//integration/,perturbed_equilibrium/, ...). Exposestages(result)/result.available.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.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
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:
Scope / suggested first slice
GPECResulttype,stages(),plots()catalog, and the precondition registry.plot_*functions (e.g. one from each Analysis submodule) into the registry as a proof of concept, rather than converting all 30 at once.Related
describe()(browsing) — Analysis UX: make gpec.h5 self-describing (units/description attrs + describe()) #328These 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).