Repository navigation
Analysis - FEATURE! - Plot from a result or a gpec.h5 path and list the available plots - #650
Open
matt-pharr wants to merge 4 commits into
Open
matt-pharr wants to merge 4 commits into
matt-pharr wants to merge 4 commits into
Conversation
matt-pharr
marked this pull request as ready for review
November 4, 2026 13:59
Collaborator
Author
|
@logan-nc this is PR 2/3 of my overhaul of how users interact with outputs. It allows for the Analysis library to do plotting through either a saved gpec.h5 file like before, or through an in-memory result object obtained by running one of our modules. This means you are able to do something like |
…he available plots
…es instead of a MethodError
matt-pharr
force-pushed
the
feature/analysis-result-plots
branch
from
November 5, 2026 22:01
2d7718c to
8f40f6a
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release note
ArgumentErrornaming what to change in the run, instead of drawing a "No … data" placeholder, returningnothingor warning (plot_cond_fbar,plot_gse_by_thetaandplot_gse_integratedused to returnnothingwithout their data).plot_delta_primeplots the Δ′ matrix of a Riccati or Galerkin solve, so it throws on Forward results.available_plots(r)shows beforehand what a result can draw.Every Analysis plot now takes the result in memory as well as the path of the
gpec.h5it was saved to:plot_ffs_summary(ffs)works likeplot_ffs_summary("gpec.h5").available_plots(r)lists the plots for a result, a file, or the named tuplemainreturns, with what to change for each one the run cannot draw; a Riccati run, for example, offers no solution-profile plot and says why.What changed
src/Analysis/Registry.jl): each plot registers the sources it takes and the capabilities it needs.capabilities(src)is the single record of what a result or file holds, andREASONSgives one sentence per capability saying what to change in the run.available_plotsis exported at the top level._require, which throws the registry's reason. The FFS, PE and ErrorFields summaries skip the panels a run cannot supply and throw only when no panel can be drawn.plot_delta_primeplots the diagonal Δ′_ii of the inter-surface Δ′ matrix from a Riccati or Galerkin solve, which is what the REPL summary shows. It used to plot a per-surface estimate from the asymptotic coefficients, whichOdeState's docstring calls a stub that is not physically valid.ErrorFieldsResult, and the coil-forcing plots (plot_coil_geometry_3d,plot_coil_geometry_rz,plot_mode_spectrum) aPerturbedEquilibriumState.PlasmaEquilibrium,LocalStabilityResult,ForceFreeStatesResult,PerturbedEquilibriumStateandErrorFieldsResultend with aPlots k of n available (see available_plots)row.docs/src/api.mdhas a new "Plotting a result" section anddocs/src/analysis.mddocuments the registry.CLAUDE.mdsays how to add a plot, a capability and a summary row.examples/Solovev_ideal_example/analyze_example.jlplots results in memory, which also fixes its reference to an undefinedp_pe.Example:
available_plotson a Riccati resultRegression report
develop @ a1149c5c2againstfeature/analysis-result-plots @ bd8fe977d(fan-out on ITER's SDCC cluster, Julia 1.12.6, pinned manifest): 27 cases, 385 quantities, all unchanged.Per-case report
Tests on ITER's SDCC cluster at b8c6526 plus the 2d7718c fix: analysis plots 207/207, ForceFreeStatesResult 280/280, solve API 182/182, error fields 397/397, Tearing 166/166.
Notes for reviewers
errors in place of placeholder plots, and the result summaries with plot availability. Its
GPECResultwrapper andplot(result, :name)were dropped by design: the typed stage results arethe objects, every plot takes one or a
gpec.h5path, andavailable_plotslists real function names._plot_x(data)functions. A follow-up plots-overhaul PR will restyle them and addplot(r)/plot!(p, r)overlay recipes; this PR leaves them alone so that work is not done twice.test/runtests_analysis_plots.jlruns a Forward run with coil forcing, PE and local stability, a Riccati run and a kinetic run. For every registered plot it checks that the plot has a method for each source it declares, reads the same data from the result and the file, and draws from both or throws the registry's reason from both.test/runtests_error_fields.jldoes the same forErrorFieldsResult, andtest/display_check.jlchecks the summaries' Plots row is present exactly when the type has registered plots.componentandmatrix_typechecks now throwArgumentErrorinstead ofErrorException.🤖 Generated with Claude Code