Skip to content

Commit 40b1475

Browse files
committed
chore: remove deprecated functionalities
1 parent 3a680ef commit 40b1475

File tree

6 files changed

+23
-108
lines changed

6 files changed

+23
-108
lines changed

ext/NonlinearSolveMINPACKExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function SciMLBase.__solve(
1919
method = ifelse(alg.method === :auto,
2020
ifelse(prob isa NonlinearLeastSquaresProblem, :lm, :hybr), alg.method)
2121

22-
show_trace = alg.show_trace || ShT
23-
tracing = alg.tracing || StT
22+
show_trace = ShT
23+
tracing = StT
2424
tol = NonlinearSolve.DEFAULT_TOLERANCE(abstol, eltype(u0))
2525

2626
if alg.autodiff === missing && prob.f.jac === nothing

ext/NonlinearSolveNLsolveExt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ function SciMLBase.__solve(
2828
end
2929

3030
abstol = NonlinearSolve.DEFAULT_TOLERANCE(abstol, eltype(u0))
31-
show_trace = ShT || alg.show_trace
32-
store_trace = StT || alg.store_trace
33-
extended_trace = !(trace_level isa TraceMinimal) || alg.extended_trace
31+
show_trace = ShT
32+
store_trace = StT
33+
extended_trace = !(trace_level isa TraceMinimal)
3434

3535
linesearch = alg.linesearch === missing ? Static() : alg.linesearch
3636

ext/NonlinearSolveSpeedMappingExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function SciMLBase.__solve(prob::NonlinearProblem, alg::SpeedMappingJL, args...;
1414
prob; alias_u0, make_fixed_point = Val(true))
1515
tol = NonlinearSolve.DEFAULT_TOLERANCE(abstol, eltype(u))
1616

17-
time_limit = ifelse(maxtime === nothing, alg.time_limit, maxtime)
17+
time_limit = ifelse(maxtime === nothing, 1000, maxtime)
1818

1919
sol = speedmapping(u; m!, tol, Lp = Inf, maps_limit = maxiters, alg.orders,
2020
alg.check_obj, store_info, alg.σ_min, alg.stabilize, time_limit)

src/algorithms/extension_algs.jl

Lines changed: 7 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -142,39 +142,15 @@ NonlinearLeastSquaresProblem.
142142
This algorithm is only available if `MINPACK.jl` is installed.
143143
"""
144144
@concrete struct CMINPACK <: AbstractNonlinearSolveExtensionAlgorithm
145-
show_trace::Bool
146-
tracing::Bool
147145
method::Symbol
148146
autodiff
149147
end
150148

151-
function CMINPACK(; show_trace = missing, tracing = missing,
152-
method::Symbol = :auto, autodiff = missing)
149+
function CMINPACK(; method::Symbol = :auto, autodiff = missing)
153150
if Base.get_extension(@__MODULE__, :NonlinearSolveMINPACKExt) === nothing
154151
error("CMINPACK requires MINPACK.jl to be loaded")
155152
end
156-
157-
if show_trace !== missing
158-
Base.depwarn(
159-
"`show_trace` for CMINPACK has been deprecated and will be removed \
160-
in v4. Use the `show_trace` keyword argument via the logging API \
161-
https://docs.sciml.ai/NonlinearSolve/stable/basics/Logging/ \
162-
instead.", :CMINPACK)
163-
else
164-
show_trace = false
165-
end
166-
167-
if tracing !== missing
168-
Base.depwarn(
169-
"`tracing` for CMINPACK has been deprecated and will be removed \
170-
in v4. Use the `store_trace` keyword argument via the logging API \
171-
https://docs.sciml.ai/NonlinearSolve/stable/basics/Logging/ \
172-
instead.", :CMINPACK)
173-
else
174-
tracing = false
175-
end
176-
177-
return CMINPACK(show_trace, tracing, method, autodiff)
153+
return CMINPACK(method, autodiff)
178154
end
179155

180156
"""
@@ -228,63 +204,26 @@ For more information on these arguments, consult the
228204
@concrete struct NLsolveJL <: AbstractNonlinearSolveExtensionAlgorithm
229205
method::Symbol
230206
autodiff
231-
store_trace::Bool
232-
extended_trace::Bool
233207
linesearch
234208
linsolve
235209
factor
236210
autoscale::Bool
237211
m::Int
238212
beta
239-
show_trace::Bool
240213
end
241214

242-
function NLsolveJL(; method = :trust_region, autodiff = :central, store_trace = missing,
243-
extended_trace = missing, linesearch = missing,
215+
function NLsolveJL(; method = :trust_region, autodiff = :central, linesearch = missing,
244216
linsolve = (x, A, b) -> copyto!(x, A \ b), factor = 1.0,
245-
autoscale = true, m = 10, beta = one(Float64), show_trace = missing)
217+
autoscale = true, m = 10, beta = one(Float64))
246218
if Base.get_extension(@__MODULE__, :NonlinearSolveNLsolveExt) === nothing
247219
error("NLsolveJL requires NLsolve.jl to be loaded")
248220
end
249221

250-
if show_trace !== missing
251-
Base.depwarn("`show_trace` for NLsolveJL has been deprecated and will be removed \
252-
in v4. Use the `show_trace` keyword argument via the logging API \
253-
https://docs.sciml.ai/NonlinearSolve/stable/basics/Logging/ \
254-
instead.",
255-
:NLsolveJL)
256-
else
257-
show_trace = false
258-
end
259-
260-
if store_trace !== missing
261-
Base.depwarn(
262-
"`store_trace` for NLsolveJL has been deprecated and will be removed \
263-
in v4. Use the `store_trace` keyword argument via the logging API \
264-
https://docs.sciml.ai/NonlinearSolve/stable/basics/Logging/ \
265-
instead.",
266-
:NLsolveJL)
267-
else
268-
store_trace = false
269-
end
270-
271-
if extended_trace !== missing
272-
Base.depwarn(
273-
"`extended_trace` for NLsolveJL has been deprecated and will be \
274-
removed in v4. Use the `trace_level = TraceAll()` keyword argument \
275-
via the logging API \
276-
https://docs.sciml.ai/NonlinearSolve/stable/basics/Logging/ instead.",
277-
:NLsolveJL)
278-
else
279-
extended_trace = false
280-
end
281-
282222
if autodiff isa Symbol && autodiff !== :central && autodiff !== :forward
283223
error("`autodiff` must be `:central` or `:forward`.")
284224
end
285225

286-
return NLsolveJL(method, autodiff, store_trace, extended_trace, linesearch,
287-
linsolve, factor, autoscale, m, beta, show_trace)
226+
return NLsolveJL(method, autodiff, linesearch, linsolve, factor, autoscale, m, beta)
288227
end
289228

290229
"""
@@ -349,25 +288,15 @@ Fixed Point Problems. We allow using this algorithm to solve root finding proble
349288
stabilize::Bool
350289
check_obj::Bool
351290
orders::Vector{Int}
352-
time_limit
353291
end
354292

355293
function SpeedMappingJL(; σ_min = 0.0, stabilize::Bool = false, check_obj::Bool = false,
356-
orders::Vector{Int} = [3, 3, 2], time_limit = missing)
294+
orders::Vector{Int} = [3, 3, 2])
357295
if Base.get_extension(@__MODULE__, :NonlinearSolveSpeedMappingExt) === nothing
358296
error("SpeedMappingJL requires SpeedMapping.jl to be loaded")
359297
end
360298

361-
if time_limit !== missing
362-
Base.depwarn("`time_limit` keyword argument to `SpeedMappingJL` has been \
363-
deprecated and will be removed in v4. Pass `maxtime = <value>` to \
364-
`SciMLBase.solve`.",
365-
:SpeedMappingJL)
366-
else
367-
time_limit = 1000
368-
end
369-
370-
return SpeedMappingJL(σ_min, stabilize, check_obj, orders, time_limit)
299+
return SpeedMappingJL(σ_min, stabilize, check_obj, orders)
371300
end
372301

373302
"""

src/algorithms/levenberg_marquardt.jl

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,11 @@ For the remaining arguments, see [`GeodesicAcceleration`](@ref) and
3131
[`NonlinearSolve.LevenbergMarquardtTrustRegion`](@ref) documentations.
3232
"""
3333
function LevenbergMarquardt(;
34-
concrete_jac = missing, linsolve = nothing, precs = DEFAULT_PRECS,
35-
damping_initial::Real = 1.0, α_geodesic::Real = 0.75,
36-
damping_increase_factor::Real = 2.0, damping_decrease_factor::Real = 3.0,
37-
finite_diff_step_geodesic = 0.1, b_uphill::Real = 1.0,
38-
autodiff = nothing, min_damping_D::Real = 1e-8, disable_geodesic = False)
39-
if concrete_jac !== missing
40-
Base.depwarn("The `concrete_jac` keyword argument is deprecated and will be \
41-
removed in v0.4. This kwarg doesn't make sense (and is currently \
42-
ignored) for LM since it needs to materialize the Jacobian to \
43-
compute the Damping Term",
44-
:LevenbergMarquardt)
45-
end
46-
34+
linsolve = nothing, precs = DEFAULT_PRECS, damping_initial::Real = 1.0,
35+
α_geodesic::Real = 0.75, damping_increase_factor::Real = 2.0,
36+
damping_decrease_factor::Real = 3.0, finite_diff_step_geodesic = 0.1,
37+
b_uphill::Real = 1.0, autodiff = nothing,
38+
min_damping_D::Real = 1e-8, disable_geodesic = False)
4739
descent = DampedNewtonDescent(; linsolve,
4840
precs,
4941
initial_damping = damping_initial,

src/internal/jacobian.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -243,17 +243,11 @@ function select_fastest_coloring_algorithm(
243243
return GreedyColoringAlgorithm(LargestFirst())
244244
end
245245

246-
function construct_concrete_adtype(f::NonlinearFunction, ad::AutoSparse)
247-
Base.depwarn(
248-
"Specifying a sparse AD type for Nonlinear Problems is deprecated. \
249-
Instead use the `sparsity`, `jac_prototype`, and `colorvec` to specify \
250-
the right sparsity pattern and coloring algorithm. Ignoring the sparsity \
251-
detection algorithm and coloring algorithm present in $(ad).",
252-
:NonlinearSolve)
253-
if f.sparsity === nothing && f.jac_prototype === nothing
254-
@set! f.sparsity = TracerSparsityDetector()
255-
end
256-
return construct_concrete_adtype(f, get_dense_ad(ad))
246+
function construct_concrete_adtype(::NonlinearFunction, ad::AutoSparse)
247+
error("Specifying a sparse AD type for Nonlinear Problems was removed in v4. \
248+
Instead use the `sparsity`, `jac_prototype`, and `colorvec` to specify \
249+
the right sparsity pattern and coloring algorithm. Ignoring the sparsity \
250+
detection algorithm and coloring algorithm present in $(ad).")
257251
end
258252

259253
get_dense_ad(ad) = ad

0 commit comments

Comments
 (0)