ALL - REFACTOR - Module-mirroring CamelCase HDF5 schema (issue #226, PR A) - #363
Open
logan-nc wants to merge 1 commit into
Open
ALL - REFACTOR - Module-mirroring CamelCase HDF5 schema (issue #226, PR A)#363logan-nc wants to merge 1 commit into
logan-nc wants to merge 1 commit into
Conversation
Physics-first reorganization of gpec.h5 into 10 CamelCase top-level groups
(Info, Input, Equilibrium, ForceFreeStates, LocalStability, SingularSurfaces,
PerturbedEquilibrium, KineticForces, Tearing, SurfaceGeometries):
- Groups CamelCase at all levels, datasets snake_case, data-driven tokens verbatim.
- splines/ -> Equilibrium/{Profiles,Geometry}; matrices/ -> ForceFreeStates/
EulerLagrangeMatrices/{Ideal,Kinetic}; integration/ -> ForceFreeStates/
Solutions/ForwardIntegration; FreeBoundaryStability/ and EdgeScan/ move under
ForceFreeStates/; slayer/ -> Tearing/ with CamelCase subgroups.
- Galerkin outputs split three ways: solution functions to Solutions/
GalerkinIntegration/Solution, RPEC matching data to .../Match (kept pending a
Galerkin-owner decision on the debug-only drop), per-surface Dp/PEST-3
results consolidated into SingularSurfaces/GalerkinDeltaPrime next to the
ideal delta_prime_matrix and GGJ coefficients.
- KineticForces: records/ -> EnergyIntegrals/, matrices_<method>/ ->
<method>/KineticMatrices/.
- Input echoes flushed (kinetic/, slayer/settings/): inputs live only under
Input/, everything else is derived output. Writer<->Rerun.jl paths locked by
shared H5_* consts.
- Fixed 8 benchmark/example readers of the long-removed vacuum/ group.
- Regression harness: case TOMLs repointed (quantity names unchanged);
extractor gains a LEGACY_PREFIX_MAP fallback so cross-commit comparisons and
--ref-range scans work across the rename boundary; retired only
kinetic_factor (x2 solovev_kinetic cases, group flushed).
- New test/runtests_h5_schema.jl enforces CamelCase group naming on a full-run
output; docs get docs/development/hdf5-conventions.md + refreshed schema
tables.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0129rSTCmYJDBbcH9khHqYnz
Collaborator
Author
|
Full |
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.
Summary
PR A of two stacked PRs closing #226: physics-first restructure of the
gpec.h5schema into 10 CamelCase top-level groups, plus the input-echo flush. PR B (self-describing metadata:long_name/units/dimension scales) follows, stacked on this branch. The settled convention is codified in the newdocs/development/hdf5-conventions.mdand enforced by the newtest/runtests_h5_schema.jl.Governing principle: the schema must be intuitive to a plasma physicist who is not a developer of this code. Groups are CamelCase at all levels, datasets snake_case, data-driven tokens (coil sets, method names, scan indices) verbatim, and inputs live only under
Input/— every other group is derived output.Schema map (old → new)
info/,input/,equil/,locstab/Info/,Input/(RawInputs/{Equilibrium,ForcingTerms,Coils}),Equilibrium/,LocalStability/splines/{profiles,rzphi}Equilibrium/{Profiles,Geometry}integration/ForceFreeStates/Solutions/ForwardIntegration/galerkin/solution/,galerkin/msingForceFreeStates/Solutions/GalerkinIntegration/{Solution/,msing}galerkin/match/**ForceFreeStates/Solutions/GalerkinIntegration/Match/**(kept — see below)galerkin/{delta,pest3_*,sing_*,di,alpha,delta_coil}SingularSurfaces/GalerkinDeltaPrime/*(Δ′ consolidates by physics next todelta_prime_matrix+ GGJ coefficients)matrices/{ideal,kinetic}ForceFreeStates/EulerLagrangeMatrices/{Ideal,Kinetic}FreeBoundaryStability/,EdgeScan/ForceFreeStates/{FreeBoundaryStability,EdgeScan}/singular/,singular/kinetic/SingularSurfaces/,SingularSurfaces/Kinetic/perturbed_equilibrium/*PerturbedEquilibrium/{ForcingModes,Response,ResponseMatrices,SingularCoupling,Energies}kinetic_forces/<m>/records,kinetic_forces/matrices_<m>KineticForces/<m>/{EnergyIntegrals,KineticMatrices}slayer/*Tearing/{PerSurface(/DpMatrix),Roots,LayerWidths,Diagnostics/{ValidRoots,Poles,FilteredRoots},Scan/Surface_<k>}kinetic/,slayer/settings/Input/gpec_toml_raw+ rerun)Reserved for the upcoming integrator options (documented, not written):
ForceFreeStates/Solutions/RiccatiIntegration/.kinetic/andslayer/settings/are deleted (pure input echoes;Rerun.jlreconstructs all control structs fromInput/gpec_toml_raw).galerkin/match/is KEPT (renamed toGalerkinIntegration/Match/), reversing the earlier "debug-only, drop it" decision: PR InnerLayer (GGJ) - NEW - rotated-ray collocation backend (:ray), robust to |Q| ~ 500 #323 deliberately added new datasets there days ago (Inner/b_<i>,InnerParams/{E,F,G,H,K,M,taua,taur,v1},bpen, …). The drop — and the question of re-homingbpen/InnerParams— is deferred to its own PR after consulting the Galerkin owner.kinetic_factor(×2 solovev_kinetic cases — group flushed). The 3galerkin/match/*tracked quantities are repointed, not retired.vacuum/group (et/ep/ev/wt0→ForceFreeStates/FreeBoundaryStability/*) — these were already broken on develop.Back-compat
Clean break in
src/readers. The regression-harness extractor gains aLEGACY_PREFIX_MAPfallback (new→old, tried when the new path is missing) so--refscomparisons and--ref-rangebisects keep working across the rename boundary — exercised by the develop side of the harness run below.Regression harness (mandatory gate) — zero numerical movement
regress --cases <all 12> --refs develop,local: every surviving quantity OK with 0.0e+00 diff.*_flux/penetrated_fieldtracks — N/A on develop too, untouched by this PR)Other verification
test/runtests_h5_schema.jl: full Solovev run → all group paths CamelCase/whitelisted, legacy top-level groups absent (20/20).runtests_rerun_from_h5.jl: bit-for-bit whole-schema source↔replay round-trip passes;runtests_slayer_runner.jl62/62;runtests_coils.jl,runtests_fullruns.jlpass.Coordination
This PR is mechanical but wide — it will conflict textually with open PRs touching writers (#354, #345, #339, #318). Please review + merge promptly and warn authors to rebase; PR B is additive/low-conflict.
Post-merge: re-run the harness once on develop to cache baselines at the merge commit; close #226 citing the conventions doc.
This PR must not be merged until a third-party human reviewer has approved it — non-negotiable project policy.
🤖 Generated with Claude Code
https://claude.ai/code/session_0129rSTCmYJDBbcH9khHqYnz