Skip to content

Commit fbaf572

Browse files
ChrisRackauckas-ClaudeCompatHelper JuliaChrisRackauckasclaude
authored
Fix SpeedMapping 0.4 compatibility (#747)
* CompatHelper: bump compat for SpeedMapping in [extras] to 0.4, (keep existing compat) * 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> --------- Co-authored-by: CompatHelper Julia <compathelper_noreply@julialang.org> Co-authored-by: ChrisRackauckas <me@chrisrackauckas.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d47550f commit fbaf572

File tree

2 files changed

+26
-14
lines changed

2 files changed

+26
-14
lines changed

Project.toml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "NonlinearSolve"
22
uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
3-
authors = ["SciML"]
43
version = "4.13.0"
4+
authors = ["SciML"]
55

66
[deps]
77
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
@@ -43,13 +43,23 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
4343
SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412"
4444
Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
4545

46-
[sources]
47-
BracketingNonlinearSolve = {path = "lib/BracketingNonlinearSolve"}
48-
NonlinearSolveBase = {path = "lib/NonlinearSolveBase"}
49-
NonlinearSolveFirstOrder = {path = "lib/NonlinearSolveFirstOrder"}
50-
NonlinearSolveQuasiNewton = {path = "lib/NonlinearSolveQuasiNewton"}
51-
NonlinearSolveSpectralMethods = {path = "lib/NonlinearSolveSpectralMethods"}
52-
SimpleNonlinearSolve = {path = "lib/SimpleNonlinearSolve"}
46+
[sources.BracketingNonlinearSolve]
47+
path = "lib/BracketingNonlinearSolve"
48+
49+
[sources.NonlinearSolveBase]
50+
path = "lib/NonlinearSolveBase"
51+
52+
[sources.NonlinearSolveFirstOrder]
53+
path = "lib/NonlinearSolveFirstOrder"
54+
55+
[sources.NonlinearSolveQuasiNewton]
56+
path = "lib/NonlinearSolveQuasiNewton"
57+
58+
[sources.NonlinearSolveSpectralMethods]
59+
path = "lib/NonlinearSolveSpectralMethods"
60+
61+
[sources.SimpleNonlinearSolve]
62+
path = "lib/SimpleNonlinearSolve"
5363

5464
[extensions]
5565
NonlinearSolveFastLevenbergMarquardtExt = "FastLevenbergMarquardt"
@@ -106,14 +116,14 @@ Random = "1.10"
106116
ReTestItems = "1.24"
107117
Reexport = "1.2.2"
108118
ReverseDiff = "1.15"
109-
SciMLLogging = "1.3"
110119
SIAMFANLEquations = "1.0.1"
111120
SciMLBase = "2.127"
121+
SciMLLogging = "1.3"
112122
SimpleNonlinearSolve = "2.11"
113123
SparseArrays = "1.10"
114124
SparseConnectivityTracer = "1"
115125
SparseMatrixColorings = "0.4.5"
116-
SpeedMapping = "0.3"
126+
SpeedMapping = "0.4"
117127
StableRNGs = "1"
118128
StaticArrays = "1.9"
119129
StaticArraysCore = "1.4"
@@ -146,9 +156,9 @@ PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b"
146156
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
147157
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
148158
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
149-
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"
150159
SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4"
151160
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
161+
SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1"
152162
SparseConnectivityTracer = "9f842d2f-2579-4b1d-911e-f412cf18a3f5"
153163
SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
154164
SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412"

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)