Skip to content

Commit 8b82b83

Browse files
committed
change errors to reference SciMLBase
1 parent ee431a9 commit 8b82b83

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

test/downstream/kwarg_warn.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using OrdinaryDiffEq, Test
2+
using DiffEqBase
23
function lorenz(du, u, p, t)
34
du[1] = 10.0(u[2] - u[1])
45
du[2] = u[1] * (28.0 - u[3]) - u[2]
@@ -8,10 +9,10 @@ u0 = [1.0; 0.0; 0.0]
89
tspan = (0.0, 100.0)
910
prob = ODEProblem(lorenz, u0, tspan)
1011
@test_nowarn sol = solve(prob, Tsit5(), reltol = 1e-6)
11-
sol = solve(prob, Tsit5(), rel_tol = 1e-6, kwargshandle = DiffEqBase.KeywordArgWarn)
12-
@test_logs (:warn, DiffEqBase.KWARGWARN_MESSAGE) sol=solve(
13-
prob, Tsit5(), rel_tol = 1e-6, kwargshandle = DiffEqBase.KeywordArgWarn)
14-
@test_throws DiffEqBase.CommonKwargError sol=solve(prob, Tsit5(), rel_tol = 1e-6)
12+
sol = solve(prob, Tsit5(), rel_tol = 1e-6, kwargshandle = SciMLBase.KeywordArgWarn)
13+
@test_logs (:warn, SciMLBase.KWARGWARN_MESSAGE) sol=solve(
14+
prob, Tsit5(), rel_tol = 1e-6, kwargshandle = SciMLBase.KeywordArgWarn)
15+
@test_throws SciMLBase.CommonKwargError sol=solve(prob, Tsit5(), rel_tol = 1e-6)
1516

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

test/downstream/solve_error_handling.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,48 @@ function f(du, u, p, t)
1010
du .= 2.0 * u
1111
end
1212
prob = ODEProblem(f, u0, tspan)
13-
@test_throws DiffEqBase.IncompatibleInitialConditionError sol=solve(prob, Tsit5())
13+
@test_throws SciMLBase.IncompatibleInitialConditionError sol=solve(prob, Tsit5())
1414

1515
prob = ODEProblem{false}(f, u0, tspan)
1616
sol = solve(prob, Tsit5())
1717
sol = solve(prob, nothing, alg = Tsit5())
1818
sol = init(prob, nothing, alg = Tsit5())
1919

2020
prob = ODEProblem{false}(f, 1.0 + im, tspan)
21-
@test_throws DiffEqBase.ComplexSupportError solve(prob, CVODE_Adams())
21+
@test_throws SciMLBase.ComplexSupportError solve(prob, CVODE_Adams())
2222

23-
@test_throws DiffEqBase.ProblemSolverPairingError solve(prob, DFBDF())
24-
@test_throws DiffEqBase.NonSolverError solve(prob, 5.0)
23+
@test_throws SciMLBase.ProblemSolverPairingError solve(prob, DFBDF())
24+
@test_throws SciMLBase.NonSolverError solve(prob, 5.0)
2525

2626
prob = ODEProblem{false}(f, u0, (nothing, nothing))
27-
@test_throws DiffEqBase.NoTspanError solve(prob, Tsit5())
27+
@test_throws SciMLBase.NoTspanError solve(prob, Tsit5())
2828

2929
prob = ODEProblem{false}(f, u0, (NaN, 1.0))
30-
@test_throws DiffEqBase.NaNTspanError solve(prob, Tsit5())
30+
@test_throws SciMLBase.NaNTspanError solve(prob, Tsit5())
3131

3232
prob = ODEProblem{false}(f, u0, (1.0, NaN))
33-
@test_throws DiffEqBase.NaNTspanError solve(prob, Tsit5())
33+
@test_throws SciMLBase.NaNTspanError solve(prob, Tsit5())
3434

3535
prob = ODEProblem{false}(f, Any[1.0, 1.0f0], tspan)
36-
@test_throws DiffEqBase.NonConcreteEltypeError solve(prob, Tsit5())
36+
@test_throws SciMLBase.NonConcreteEltypeError solve(prob, Tsit5())
3737

3838
prob = ODEProblem{false}(f, (1.0, 1.0f0), tspan)
39-
@test_throws DiffEqBase.TupleStateError solve(prob, Tsit5())
39+
@test_throws SciMLBase.TupleStateError solve(prob, Tsit5())
4040

4141
prob = ODEProblem{false}(f, u0, (0.0 + im, 1.0))
42-
@test_throws DiffEqBase.ComplexTspanError solve(prob, Tsit5())
42+
@test_throws SciMLBase.ComplexTspanError solve(prob, Tsit5())
4343

4444
for u0 in ([0.0, 0.0], nothing)
4545
fmm = ODEFunction(f, mass_matrix = zeros(3, 3))
4646
prob = ODEProblem(fmm, u0, (0.0, 1.0))
47-
@test_throws DiffEqBase.IncompatibleMassMatrixError solve(prob, Tsit5())
47+
@test_throws SciMLBase.IncompatibleMassMatrixError solve(prob, Tsit5())
4848
end
4949

5050
# Allow empty mass matrix for empty u0
5151
fmm = ODEFunction((du, u, t) -> nothing, mass_matrix = zeros(0, 0))
5252
prob = ODEProblem(fmm, nothing, (0.0, 1.0))
5353
sol = solve(prob, Tsit5())
54-
@test isa(sol, DiffEqBase.ODESolution)
54+
@test isa(sol, SciMLBase.ODESolution)
5555

5656
f(du, u, p, t) = du .= 1.01u
5757
function g(du, u, p, t)
@@ -71,12 +71,12 @@ prob = SDEProblem(f,
7171
(0.0, 1.0),
7272
noise_rate_prototype = complex(zeros(2, 4)),
7373
noise = StochasticDiffEq.RealWienerProcess(0.0, zeros(3)))
74-
@test_throws DiffEqBase.NoiseSizeIncompatabilityError solve(prob, LambaEM())
74+
@test_throws SciMLBase.NoiseSizeIncompatabilityError solve(prob, LambaEM())
7575

7676
function g!(du, u, p, t)
7777
du[1] .= u[1] + ones(3, 3)
7878
du[2] .= ones(3, 3)
7979
end
8080
u0 = [zeros(3, 3), zeros(3, 3)]
8181
prob = ODEProblem(g!, u0, (0, 1.0))
82-
@test_throws DiffEqBase.NonNumberEltypeError solve(prob, Tsit5())
82+
@test_throws SciMLBase.NonNumberEltypeError solve(prob, Tsit5())

0 commit comments

Comments
 (0)