Skip to content

Commit cca0b4c

Browse files
Fix SpeedMapping 0.4 compatibility (drop 0.3 support)
SpeedMapping 0.4 introduced breaking API changes: - `converged::Bool` -> `status::Symbol` in return type - `tol` -> `abstol` - `Lp` -> `pnorm` - `store_info` -> `store_trace` - `σ_min` -> `initial_learning_rate` - `orders::Vector{Int}` -> `orders::Tuple` This commit updates the extension to use the 0.4 API exclusively and changes the compat entry from "0.3, 0.4" to "0.4". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 7946442 commit cca0b4c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ SimpleNonlinearSolve = "2.11"
123123
SparseArrays = "1.10"
124124
SparseConnectivityTracer = "1"
125125
SparseMatrixColorings = "0.4.5"
126-
SpeedMapping = "0.3, 0.4"
126+
SpeedMapping = "0.4"
127127
StableRNGs = "1"
128128
StaticArrays = "1.9"
129129
StaticArraysCore = "1.4"

ext/NonlinearSolveSpeedMappingExt.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ function SciMLBase.__solve(
2929
time_limit = ifelse(maxtime === nothing, 1000, maxtime)
3030

3131
sol = speedmapping(
32-
u; m!, tol, Lp = Inf, maps_limit = maxiters, alg.orders,
33-
alg.check_obj, store_info = store_trace isa Val{true}, alg.σ_min, alg.stabilize,
32+
u; m!, abstol = tol, pnorm = Inf, maps_limit = maxiters,
33+
orders = Tuple(alg.orders),
34+
initial_learning_rate = alg.σ_min == 0.0 ? 1.0 : alg.σ_min,
35+
store_trace = store_trace isa Val{true},
3436
time_limit
3537
)
3638
res = prob.u0 isa Number ? first(sol.minimizer) : sol.minimizer
@@ -39,7 +41,7 @@ function SciMLBase.__solve(
3941
return SciMLBase.build_solution(
4042
prob, alg, res, resid;
4143
original = sol, stats = SciMLBase.NLStats(sol.maps, 0, 0, 0, sol.maps),
42-
retcode = ifelse(sol.converged, ReturnCode.Success, ReturnCode.Failure)
44+
retcode = ifelse(sol.status == :first_order, ReturnCode.Success, ReturnCode.Failure)
4345
)
4446
end
4547

0 commit comments

Comments
 (0)