EQUIL - IMPROVEMENT - Scope custom-Jacobian knobs to jac_custom_power_*#311
Merged
Conversation
Rename the custom Jacobian selector jac_type = "other" to "custom" and add user-facing jac_custom_power_bp/b/r/rc inputs to EquilibriumConfig, read only when jac_type = "custom". Named types (hamada/pest/boozer/equal_arc/park) keep forcing the internal power_* exponents; downstream Jacobian formulas are unchanged and still read the internal power_* fields as the single source of truth. The four power_* constructor slots are now derived-only (marked `_`). Deprecate power_bp/power_b/power_r/power_rc as [Equilibrium] TOML input keys by reusing the centralized deprecation mechanism: generalize _drop_deprecated_ffs_keys! to _drop_deprecated_keys!(table, keys, section) and add _DEPRECATED_EQUIL_KEYS, applied on both the gpec.toml and h5-replay input paths. A stale power_* key now warns loudly and is dropped instead of silently overriding the coordinate system. Also fix the _DEPRECATED_FFS_KEYS one-tuple bug (was a string, so the FFS deprecation never fired). Update the EquilibriumConfig docstring and conventions.md, and clean the now-inactive power_* lines out of the example/test gpec.toml files while standardizing the jac_type option-list comment. Regression: diiid_n1, solovev_n1, solovev_multi_n all 0.0e+00 diff vs develop. Closes #288 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Closes #288.
Problem
In
[Equilibrium], the Jacobian coordinate system is chosen withjac_type. For named systems (hamada,pest,boozer,equal_arc,park) the constructor forces a fixed set of exponents, yet the rawpower_bp/power_b/power_r/power_rcwere exposed as top-level keys that look universal but only mattered whenjac_type = "other". Listing them (as0) in every example implied false relevance, and setting one on a named-type run was silently ignored.Changes
Custom-Jacobian knobs (
src/Equilibrium/EquilibriumTypes.jl)jac_type = "other"→jac_type = "custom"(clearer intent; no shim — no stable API pre-2.0.0).jac_custom_power_bp/b/r/rc(default 0), read only at construction whenjac_type = "custom", then copied into the internalpower_*. The existing "recognize a named type from the exponents" normalization is retained (fast paths still taken).power_*and ignore the custom knobs.FieldLineDerivParamsand every Jacobian formula (DirectEquilibrium.jl,DirectEquilibriumArcLength.jl,InverseEquilibrium.jl) keep reading the internalpower_*fields as the single source of truth. The four now derived-only constructor slots are marked_.Deprecate
power_*as TOML input keys (reusing the centralized mechanism)_drop_deprecated_ffs_keys!(table)→_drop_deprecated_keys!(table, deprecated_keys, section)insrc/GeneralizedPerturbedEquilibrium.jl._DEPRECATED_EQUIL_KEYS = ("power_bp", "power_b", "power_r", "power_rc"), applied on both thegpec.toml(build_inputs_from_toml) and h5-replay (src/Rerun.jl) input paths. A stalepower_*key now warns loudly and is dropped instead of silently overriding the coordinate system._DEPRECATED_FFS_KEYS = ("mer_flag")was a string (not a 1-tuple), sofor k in …iterated its characters and the FFS deprecation never fired. Now("mer_flag",).Docs & examples
EquilibriumConfigdocstring (surfaced via@autodocs) anddocs/src/conventions.mdto documentcustomand thejac_custom_power_*fields withJ = Bp^bp · B^b / (R^r · rfac^rc).jac_typeoption-list comment to(hamada, pest, boozer, equal_arc, park, custom)and remove the now-inactivepower_*lines from the example/testgpec.tomlfiles (safe — named types force the exponents regardless of file contents).Verification
customcopies knobs → internal exponents and normalizes to the named fast path when they match; a non-standard set stayscustomwith manual exponents; named types force exponents and ignore custom knobs; the deprecation warns + drops and the config still builds fromjac_type; all 19 example/testgpec.tomlfiles parse.diiid_n1,solovev_n1,solovev_multi_n, local vs develop): every quantity 0.0e+00 diff — the change is numerically inert.🤖 Generated with Claude Code