Repository navigation
Rename the fit API so every entry point leads with its verb - #45
Merged
Merged
Conversation
`gg_fit` becomes `gg_calc_fit`, `gg_fit_show_results` becomes `gg_show_fit_results`, `gg_fit_residual_map` becomes `gg_make_fit_residual_table`, and `gg_fit_show_residuals` becomes `gg_show_fit_residuals`. The four exported entry points now read verb-first -- calc, show, make, show -- instead of burying the action behind a `gg_fit` prefix that a residual map never had much claim to. The `GGCoefs` a fit returns is named `gg_fit` in place of `results`, in the four public signatures, the two private helpers that take one, and every docstring and example. `results` said nothing about what the object was; the qualified name keeps the package visible in scripts that mix this fit with other code. Note that the export and evaluation side (`read_gg_fit`, `write_bmad_gg_fit`, `gg_to_bmad_curves`) still calls the same struct `fit`. Names that merely contain `gg_fit` are untouched: `read_gg_fit`, `write_gg_fit`, `write_bmad_gg_fit`, `_interp_gg_fit`, the `gg_fit_result.h5` files, and `src/gg_fit.jl` itself. There are no deprecation shims -- nothing outside the repository uses these names. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
📖 Documentation preview for this PR: https://bmad-sim.github.io/GeneralizedGradients.jl/previews/PR45/ Rebuilt on every push; removed automatically when the PR closes. |
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.
Pure rename. No behaviour changes anywhere.
Functions
gg_fitgg_calc_fitgg_fit_show_resultsgg_show_fit_resultsgg_fit_residual_mapgg_make_fit_residual_tablegg_fit_show_residualsgg_show_fit_residualsAll four exported entry points now read verb-first — calc, show, make, show — rather than putting the action last behind a
gg_fitprefix, which the residual table never really fit under anyway.Variable
The
GGCoefsa fit returns is calledgg_fitinstead ofresults, in the four public signatures, the two private helpers that take one (_gg_taylor_getters,_gg_field_contributions), and every docstring, example and guide code block.resultssaid nothing about what the object was; the qualified name keeps the package identifiable in a script that mixes this fit with other code.Four occurrences of "results" that were ordinary English rather than the variable were left alone (
README.md,examples/README.md,low_level.jl:238, one test comment).What was deliberately not renamed
Names that merely contain
gg_fitas a substring:read_gg_fit,write_gg_fit,write_bmad_gg_fit,_interp_gg_fit, thegg_fit_result.h5data files, and the filesrc/gg_fit.jlitself. The rename was word-boundary anchored so none of these moved.There are no deprecation aliases — nothing outside this repository uses the old names.
Known inconsistency, not addressed here
The export/evaluation half of the package still names the same struct
fit:read_gg_fitreturns(fit::GGCoefs, meta), andwrite_bmad_gg_fit(fit; …),gg_to_bmad_curves(fit)andexamples/BeamTracking_example.jlfollow it. So you get the qualified name when you produce a fit and the bare one when you load one back. Unifying that is ~25 more occurrences and a separate decision.Verification
Pkg.test()— 1125 pass, unchanged from before the rename.examples/run_gg_fit.jlruns to completion.gg_show_fit_residualsandgg_make_fit_residual_tableexercised on the real field map.old/.🤖 Generated with Claude Code