Skip to content

Commit 56298a7

Browse files
Change default kwargs handle from warn to error
We have had this around for long enough to enable it.
1 parent 456cb3d commit 56298a7

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/solve.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const allowedkeywords = (:dense,
8888
:linsolve_kwargs)
8989

9090
const KWARGWARN_MESSAGE = """
91-
Unrecognized keyword arguments found. Future versions will error.
91+
Unrecognized keyword arguments found.
9292
The only allowed keyword arguments to `solve` are:
9393
$allowedkeywords
9494
@@ -450,7 +450,7 @@ function Base.showerror(io::IO, e::IncompatibleMassMatrixError)
450450
println(io, TruncatedStacktraces.VERBOSE_MSG)
451451
end
452452

453-
function init_call(_prob, args...; merge_callbacks = true, kwargshandle = KeywordArgWarn,
453+
function init_call(_prob, args...; merge_callbacks = true, kwargshandle = KeywordArgError,
454454
kwargs...)
455455
if has_kwargs(_prob)
456456
if merge_callbacks && haskey(_prob.kwargs, :callback) && haskey(kwargs, :callback)

test/downstream/kwarg_warn.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ u0 = [1.0; 0.0; 0.0]
88
tspan = (0.0, 100.0)
99
prob = ODEProblem(lorenz, u0, tspan)
1010
@test_nowarn sol = solve(prob, Tsit5(), reltol = 1e-6)
11-
sol = solve(prob, Tsit5(), rel_tol = 1e-6)
11+
sol = solve(prob, Tsit5(), rel_tol = 1e-6, kwargshandle = DiffEqBase.KeywordArgWarn)
1212
@test_logs (:warn, DiffEqBase.KWARGWARN_MESSAGE) sol=solve(prob, Tsit5(), rel_tol = 1e-6)
13-
@test_throws DiffEqBase.CommonKwargError sol=solve(prob, Tsit5(), rel_tol = 1e-6,
14-
kwargshandle = DiffEqBase.KeywordArgError)
13+
@test_throws DiffEqBase.CommonKwargError sol=solve(prob, Tsit5(), rel_tol = 1e-6)
1514

16-
prob = ODEProblem(lorenz, u0, tspan, test = 2.0)
15+
prob = ODEProblem(lorenz, u0, tspan, test = 2.0, kwargshandle = DiffEqBase.KeywordArgWarn)
1716
@test_logs (:warn, DiffEqBase.KWARGWARN_MESSAGE) sol=solve(prob, Tsit5(), reltol = 1e-6)

0 commit comments

Comments
 (0)