Repository navigation
Equilibrium - REFACTOR - Arrange the Equilibrium module by pipeline stage - #551
Conversation
… Equilibrium.jl into their own files Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
logan-nc
left a comment
There was a problem hiding this comment.
Checked mechanically rather than by reading 5,500 lines: after whitespace normalisation, every removed line reappears as an added line except 30, and every added line was present before except 51; all 81 are include(...) paths, the # File.jl headers, and path references in the two docs pages and test/runtests_equil.jl. So this is a pure move, and the relative includes in Sources/Analytic/Analytic.jl resolve to files that exist on the branch. Two notes: #548 (its base) merged today, so this needs a retarget and rebase onto develop; and #581 also edits Equilibrium.jl and EquilibriumTypes.jl, which this PR moves to Config.jl/PlasmaEquilibrium.jl, so whichever of the two lands second pays the conflict.
|
@logan-nc I am going to take your comment as an approval here. I will make sure that all PRs open that edit equilibrium are rebased correctly onto this when it goes in. I cc'ed @jhalpern30 as a reviewer as well on this so he can see how I am reorganizing things. I have one more PR that is still unopened that will edit the Equilibrium submodule a liottle bit, so @jhalpern30 feel free to leave comments here and I can address them in that PR. But I am going to merge this now to avoid a huge dependency chain today so we can keep things rolling for 2.0.0 work. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…docstring Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Release note
src/Equilibrium/is arranged by pipeline stage.Equilibrium.jlholds the module docstring, imports, constants, includes and exports.Config.jl,PlasmaEquilibrium.jlandConstruction.jlhold the configs, the result type and how it is formed.Sources/has one file per input format, the ingest types andAnalytic/.Grid/holds the ψ grids,Axisymmetric/the 2D solvers, Grad-Shafranov residual and separatrix finding, andDerived/the quantities computed from a formed equilibrium. Its docstring states which folder new code belongs in.Regression report
Compared against
develop@e0324a91d, with this branch @f5e1f9459: every tracked quantity is bit-identical (81 rows at0.0e+00, 9 identical checksums).Notes for reviewers
Pure move, no code changes, plus one docs commit: the
Equilibriummodule docstring inEquilibrium.jlnow says where code goes, so new code lands in the right folder. Otherwise only file locations and include order change;develop(including Equilibrium - FEATURE! - Store the analytic config on PlasmaEquilibrium and re-form every source from it #548) is merged in. A script compared the non-blank lines of the whole module before and after: none were added or removed apart from include lines and two header comments that this PR had itself added earlier.Layout:
Where the pieces came from:
EquilibriumTypes.jlwas split intoConfig.jl,Sources/Ingest.jl, the analytic files andPlasmaEquilibrium.jl.ReadEquilibrium.jlwas split into one file per format, withbuild_*_from_ingestgoing toIngest.jl.AnalyticEquilibrium.jlwas split into the three model files, each now holding its config and its solver.DirectEquilibrium.jltoGrid/PsiGrid.jl.git mv.Include order:
ANALYTIC_EQis built when its file loads, so it needs the model solvers, and the model configs subtypeAnalyticEquilibriumConfig. SoSources/Analytic/Analytic.jldefines the abstract type, then includes the three model files, then builds the registry. These are the only nested includes.KineticProfileSplinessits inPlasmaEquilibrium.jlbecauseGridRefinement.jl's method signatures need it at load time.Text-only edits outside the move:
test/runtests_equil.jlreads the direct solver's source as text, so its path now points toAxisymmetric/Direct.jl.docs/src/conventions.md, the header ofSeparatrix.jl, a comment inTJAnalytic.jl, and the Key-files list indocs/development/architecture.md.Reading the diff:
git diff --color-movedor GitHub's moved-line view shows the blocks as moved.Where things moved (for open PRs that edit these files):
EquilibriumTypes.jlConfig.jl(EquilibriumConfig,EquilibriumParameters,symbolize_keys),Sources/Ingest.jl(ingest and run-input types),Sources/Analytic/Analytic.jl(AnalyticEquilibriumConfig), the analytic model files (their configs),PlasmaEquilibrium.jl(spline containers and the result type)ReadEquilibrium.jlSources/GFile.jl,Sources/Chease.jl,Sources/IFile.jl,Sources/IMAS.jl;build_*_from_ingestinSources/Ingest.jlAnalyticEquilibrium.jlSources/Analytic/Solovev.jl,LargeAspectRatio.jl,TJAnalytic.jlEquilibrium.jl(body)Construction.jl(run_input, constructors,reform),Sources/Analytic/Analytic.jl(ANALYTIC_EQ),Axisymmetric/Separatrix.jl,Derived/GlobalParameters.jl,Axisymmetric/GradShafranovResidual.jlDirectEquilibrium.jlAxisymmetric/Direct.jl;make_optimal_psi_gridand_build_psi_gridinGrid/PsiGrid.jlDirectEquilibriumArcLength.jl,DirectEquilibriumByInversion.jl,InverseEquilibrium.jl,SolveTolerances.jlAxisymmetric/DirectArcLength.jl,DirectByInversion.jl,Inverse.jl,SolveTolerances.jlSeparatrixQLaw.jlAxisymmetric/Separatrix.jlGridRefinement.jlGrid/GridRefinement.jlFluxSurfaceMetrics.jl,GeometryProfiles.jl,CoordinateInvariant.jlDerived/KineticProfiles.jlWhole-file moves follow automatically when an open PR merges
develop. Edits to the split files (EquilibriumTypes.jl,ReadEquilibrium.jl,AnalyticEquilibrium.jl, theEquilibrium.jlbody, the ψ grid builders) need porting by hand to the new location.🤖 Generated with Claude Code