Skip to content

FFS - REFACTOR - Extract local stability into standalone LocalStability module (refactor plan PR 2) - #387

Merged
matt-pharr merged 1 commit into
refactor/riccati-unificationfrom
refactor/local-stability-module
Aug 15, 2026
Merged

FFS - REFACTOR - Extract local stability into standalone LocalStability module (refactor plan PR 2)#387
matt-pharr merged 1 commit into
refactor/riccati-unificationfrom
refactor/local-stability-module

Conversation

@matt-pharr

@matt-pharr matt-pharr commented Aug 15, 2026

Copy link
Copy Markdown
Collaborator

PR 2 of the refactor sequence in REFACTOR_PLAN.md (§4). Stacked on #381 (refactor/riccati-unification) — this PR shows only the LocalStability extraction; review/merge #381 first. When #381 merges and its branch is deleted, GitHub retargets this PR to develop. The remaining work (original PRs 3–5) lands as a single combined interface PR on refactor/forcefreestates-result, stacked on this one.

What this does

  • Moves Ballooning.jl (Mercier D_I, resistive interchange D_R, high-n ballooning Δ′ scans and s–α drivers) out of ForceFreeStates into a new top-level LocalStability module via git mv (history preserved).
  • LocalStability depends only on Equilibrium plus math libraries — no stability-solver state. The HDF5 group LocalStability/* (from ALL - REFACTOR - Module-mirroring CamelCase HDF5 schema (issue #226, PR A) #363) already matches the module name, so no dataset paths change.
  • Every entry point drops the ForceFreeStatesControl argument (it only ever supplied verbose) in favor of a verbose::Bool=false kwarg: compute_local_stability(equil; verbose), ballooning_alpha_boundary(equil; …), ballooning_alpha_boundaries, ballooning_qprime_boundaries, scan_delta_prime_map, ballooning_delta_prime_map, ballooning_qprime_delta_prime_map, compute_ballooning_stability!.
  • ctrl.local_stability_flag stays in [ForceFreeStates] (the driver reads it); a [LocalStability] TOML section is deliberately out of scope.
  • Updated call sites: driver (main_from_inputs), test/runtests_resist_eval.jl, examples/DIIID-like_ideal_example/analyze_example.jl (also sheds a throwaway ForceFreeStatesControl construction), Analysis docstring cross-references.
  • Docs: Ballooning.jl removed from stability.md's @autodocs Pages; new @autodocs block for LocalStability in ballooning.md (satisfies checkdocs=:exports); architecture.md module list/dependency tree updated to eight modules.

No numerical changes: pure code motion plus signature mechanics.

Verification

  • runtests_resist_eval.jl 63/63 and runtests_fullruns.jl 17/17 pass on this tree; zero stale ForceFreeStates.*ballooning* references (grep across src/test/examples/benchmarks/docs).
  • Full test suite
  • Docs build (build_docs_local.jl)
  • Regression harness vs stack base (--refs refactor/riccati-unification,local; expected: LocalStability/* datasets identical) — pasted here before this PR leaves draft

⚠️ Review requirement

This PR must not be merged without a third-party human reviewer's approval — non-negotiable (see REFACTOR_PLAN.md §8).

🤖 Generated with Claude Code

@matt-pharr
matt-pharr requested a review from logan-nc August 15, 2026 03:10
@matt-pharr
matt-pharr marked this pull request as ready for review August 15, 2026 03:11

@logan-nc logan-nc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another great re-org.
Human diff review complete - are you happy Claude??

@logan-nc logan-nc self-assigned this Aug 15, 2026
@logan-nc logan-nc assigned matt-pharr and unassigned logan-nc Aug 15, 2026
@logan-nc

Copy link
Copy Markdown
Collaborator

@matt-pharr I assigned you to hit merge in case there was a fancy ordering you preferred for your PRs

@matt-pharr
matt-pharr merged commit 068ad49 into refactor/riccati-unification Aug 15, 2026
3 checks passed
@matt-pharr
matt-pharr deleted the refactor/local-stability-module branch August 15, 2026 19:11
@logan-nc

Copy link
Copy Markdown
Collaborator

🚀

@logan-nc logan-nc added the refactor Behavior-preserving restructuring label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Behavior-preserving restructuring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants