Migrate to CTBase 0.28 parameter contract#172
Merged
Conversation
Adapt all strategies to the CTBase.jl v0.28.0-beta breaking changes:
- Rename `_default_parameter` → `default_parameter` in all strategies and tests
- Implement `Strategies.parameter(::Type{<:S{P}})` for all 7 parameterized
strategies (ADNLP, Exa, Ipopt, Knitro, MadNLP, MadNCL, Uno)
- Implement `Strategies.parameter(::Type{<:SciML}) = nothing` for the
non-parameterized SciML integrator
- Replace all `get_parameter_type` calls with `parameter` in tests
- Add `parameter` and `default_parameter` to fake test strategies
- Update docs guides (implementing_a_solver, implementing_a_modeler,
architecture) with the new contract names
- Rewrite historical BREAKING.md and CHANGELOG.md entries
- Add docstrings for all `parameter` methods following Handbook templates
- Bump CTBase compat to 0.28 and CTModels to 0.15
Closes #171
Member
Author
|
Closes #171. |
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
This PR migrates all CTSolvers strategies to the breaking changes introduced in CTBase.jl v0.28.0-beta.
Closes #171.
Changes
Source code (8 strategy files)
Strategies._default_parameter→Strategies.default_parameterin all 7 parameterized strategies (ADNLP,Exa,Ipopt,Knitro,MadNLP,MadNCL,Uno) and all their call sites (constructors, metadata fallbacks).Strategies.parameter(::Type{<:S{P}}) where {P<:Bound} = Pfor each of the 7 parameterized strategies, with the appropriate type bound (CPUfor CPU-only,Union{CPU,GPU}for GPU-capable).Strategies.parameter(::Type{<:SciML}) = nothingfor the non-parameterizedSciMLintegrator.parametermethod, following the Handbook docstring templates ($(TYPEDSIGNATURES), one-sentence summary,# Returns,See also:with cross-references).Tests (11 files)
_default_parametercalls withdefault_parameter.get_parameter_typecalls withparameter.parameter(anddefault_parameterwhere needed) to fake test strategies intest_backward_compatibility.jl,test_integration_parameters.jl,test_alias_integration.jl, andtest_mode_propagation.jl.test_parameter_contract.jlto test theparameterfallback (in addition todefault_parameter), with assertions matching CTBase's actual error message format.Documentation (3 guide files)
implementing_a_solver.md: Updated contract list, code examples, and summary checklist to referenceparameteranddefault_parameterinstead of_default_parameter.implementing_a_modeler.md: Same updates, includingExaexample withUnion{CPU,GPU}parameter method.architecture.md: Updated tag-dispatch example and parameter resolution description.Historical files
BREAKING.md: Rewrote v0.4.0-beta entries to useparameter/default_parameterinstead of_supported_parameters/_default_parameter.CHANGELOG.md: Same updates for the v0.4.0-beta section.Project.toml
0.26, 0.27to0.28.0.14, 0.15to0.15.0.4.27-beta.docs/Project.tomlCTBase compat accordingly.Verification
All 393 strategy tests pass: