Skip to content

Commit 1ef01f8

Browse files
depwarn fixes
1 parent 0dd11d3 commit 1ef01f8

14 files changed

+38
-38
lines changed

test/adaptive/sde_weak_adaptive.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function reduction(u,batch,I)
2323
end
2424

2525
function output_func(sol,i)
26-
#h1(asinh(sol[end][1])),false
26+
#h1(asinh(sol.u[end][1])),false
2727
h1.(asinh.(sol)),false
2828
end
2929

test/complex_tests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ implicit_noautodiff = [SKenCarp(autodiff=false), ImplicitEulerHeun(autodiff=fals
1515

1616
for alg in Iterators.flatten((explicit, implicit_noautodiff))
1717
sol = solve(prob, alg)
18-
@test eltype(sol[end]) == ComplexF64
18+
@test eltype(sol.u[end]) == ComplexF64
1919
end
2020

2121
# currently broken
@@ -34,7 +34,7 @@ end
3434

3535
for alg in Iterators.flatten((explicit, implicit_noautodiff))
3636
sol = solve(prob, alg)
37-
@test eltype(sol[end]) == ComplexF64
37+
@test eltype(sol.u[end]) == ComplexF64
3838
end
3939

4040
# currently broken

test/gpu/sde_weak_adaptive_gpu.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function reduction(u,batch,I)
2525
end
2626

2727
function output_func(sol,i)
28-
#h1(asinh(sol[end][1])),false
28+
#h1(asinh(sol.u[end][1])),false
2929
h1.(asinh.(sol)),false
3030
end
3131

test/rode_linear_tests.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ prob = RODEProblem(f,u0,tspan)
88
sol = solve(prob,RandomEM(),dt=1/100, save_noise=true)
99
prob = RODEProblem(f,u0,tspan, noise=NoiseWrapper(sol.W))
1010
sol2 = solve(prob,RandomHeun(),dt=1/100)
11-
@test abs(sol[end] - sol2[end]) < 0.1 * abs(sol[end])
11+
@test abs(sol.u[end] - sol2[end]) < 0.1 * abs(sol.u[end])
1212
sol3 = solve(prob,RandomTamedEM(),dt=1/100)
13-
@test abs(sol[end] - sol3[end]) < 0.1 * abs(sol[end])
13+
@test abs(sol.u[end] - sol3[end]) < 0.1 * abs(sol.u[end])
1414

1515
f(du,u,p,t,W) = (du.=1.01u.+0.87u.*W)
1616
u0 = ones(4)
1717
prob = RODEProblem(f,u0,tspan)
1818
sol = solve(prob,RandomEM(),dt=1/100, save_noise=true)
1919
prob = RODEProblem(f,u0,tspan, noise=NoiseWrapper(sol.W))
2020
sol2 = solve(prob,RandomHeun(),dt=1/100)
21-
@test sum(abs,sol[end]-sol2[end]) < 0.1 * sum(abs, sol[end])
21+
@test sum(abs,sol.u[end]-sol2[end]) < 0.1 * sum(abs, sol.u[end])
2222
sol3 = solve(prob,RandomEM(),dt=1/100)
23-
@test sum(abs,sol[end]-sol3[end]) < 0.1 * sum(abs, sol[end])
23+
@test sum(abs,sol.u[end]-sol3[end]) < 0.1 * sum(abs, sol.u[end])
2424

2525
f(u,p,t,W) = 2u*sin(W)
2626
u0 = 1.00
@@ -29,9 +29,9 @@ prob = RODEProblem{false}(f,u0,tspan)
2929
sol = solve(prob,RandomEM(),dt=1/100, save_noise=true)
3030
prob = RODEProblem{false}(f,u0,tspan, noise=NoiseWrapper(sol.W))
3131
sol2 = solve(prob,RandomHeun(),dt=1/100)
32-
@test abs(sol[end]-sol2[end]) < 0.1 * abs(sol[end])
32+
@test abs(sol.u[end]-sol2[end]) < 0.1 * abs(sol.u[end])
3333
sol3 = solve(prob,RandomTamedEM(),dt=1/100)
34-
@test abs(sol[end]-sol3[end]) < 0.1 * abs(sol[end])
34+
@test abs(sol.u[end]-sol3[end]) < 0.1 * abs(sol.u[end])
3535

3636
function f(du,u,p,t,W)
3737
du[1] = 0.2u[1]*sin(W[1] - W[2])
@@ -43,9 +43,9 @@ prob = RODEProblem(f,u0,tspan)
4343
sol = solve(prob,RandomEM(),dt=1/100, save_noise=true)
4444
prob = RODEProblem(f,u0,tspan, noise=NoiseWrapper(sol.W))
4545
sol2 = solve(prob,RandomHeun(),dt=1/100)
46-
@test sum(abs,sol[end]-sol2[end]) < 0.1 * sum(abs, sol[end])
46+
@test sum(abs,sol.u[end]-sol2[end]) < 0.1 * sum(abs, sol.u[end])
4747
sol3 = solve(prob,RandomTamedEM(),dt=1/100)
48-
@test sum(abs,sol[end]-sol3[end]) < 0.1 * sum(abs, sol[end])
48+
@test sum(abs,sol.u[end]-sol3[end]) < 0.1 * sum(abs, sol.u[end])
4949

5050
function f(du,u,p,t,W)
5151
du[1] = -0.2W[3]*u[1]*sin(W[1] - W[2])
@@ -57,6 +57,6 @@ prob = RODEProblem(f,u0,tspan,rand_prototype=zeros(3))
5757
sol = solve(prob,RandomEM(),dt=1/100, save_noise=true)
5858
prob = RODEProblem(f,u0,tspan, noise=NoiseWrapper(sol.W))
5959
sol2 = solve(prob,RandomHeun(),dt=1/100)
60-
@test sum(abs,sol[end]-sol2[end]) < 0.1 * sum(abs, sol[end])
60+
@test sum(abs,sol.u[end]-sol2[end]) < 0.1 * sum(abs, sol.u[end])
6161
sol3 = solve(prob,RandomTamedEM(),dt=1/100)
62-
@test sum(abs,sol[end]-sol3[end]) < 0.1 * sum(abs, sol3[end])
62+
@test sum(abs,sol.u[end]-sol3[end]) < 0.1 * sum(abs, sol3[end])

test/split_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ prob = SDEProblem{false}(f,σ,u0,(0.0,1.0),noise = NoiseWrapper(sol.W))
2525

2626
sol2 = solve(prob,EM(),dt=1/10)
2727

28-
@test sol[end][:] sol2[end][:]
28+
@test sol.u[end][:] sol2[end][:]
2929

3030
################################################################################
3131

test/tdir_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ prob = SDEProblem(f,g,u₀,(0.0,1.0))
2626
sol =solve(prob,EulerHeun(),dt=0.01,save_noise=true)
2727
_sol = deepcopy(sol) # to make sure the plot is correct
2828
W3 = NoiseGrid(reverse!(_sol.t),reverse!(_sol.W))
29-
prob3 = SDEProblem(f,g,sol[end],(1.0,0.0),noise=W3)
29+
prob3 = SDEProblem(f,g,sol.u[end],(1.0,0.0),noise=W3)
3030
sol2 = solve(prob3,EulerHeun(),dt=0.01)
3131
@test sol.u reverse!(sol2.u) atol=1e-1

test/weak_convergence/PL1WM.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ seeds = rand(UInt, numtraj)
3838

3939
prob = SDEProblem(f,g,u₀,tspan,p)
4040
ensemble_prob = EnsembleProblem(prob;
41-
output_func = (sol,i) -> (h1(sol[end]),false),
41+
output_func = (sol,i) -> (h1(sol.u[end]),false),
4242
prob_func = prob_func
4343
)
4444

@@ -67,7 +67,7 @@ p = [3//2,1//100]
6767

6868
prob = SDEProblem(f1!,g1!,u₀,tspan,p)
6969
ensemble_prob = EnsembleProblem(prob;
70-
output_func = (sol,i) -> (h1(sol[end][1]),false),
70+
output_func = (sol,i) -> (h1(sol.u[end][1]),false),
7171
prob_func = prob_func
7272
)
7373

@@ -124,7 +124,7 @@ h2(z) = z
124124

125125
prob = SDEProblem(f2!,g2!,u₀,tspan,p,noise_rate_prototype=zeros(4,4))
126126
ensemble_prob = EnsembleProblem(prob;
127-
output_func = (sol,i) -> (h2(sol[end][1]),false),
127+
output_func = (sol,i) -> (h2(sol.u[end][1]),false),
128128
prob_func = prob_func
129129
)
130130

@@ -164,7 +164,7 @@ h3(z) = z^2 # == 1//10**exp(3//2*t) if h3(z) = z and == 1//100**exp(301//100*t)
164164

165165
prob = SDEProblem(f3!,g3!,u₀,tspan)
166166
ensemble_prob = EnsembleProblem(prob;
167-
output_func = (sol,i) -> (h3(sol[end][1]),false),
167+
output_func = (sol,i) -> (h3(sol.u[end][1]),false),
168168
prob_func = prob_func
169169
)
170170

@@ -200,7 +200,7 @@ seeds = rand(UInt, numtraj)
200200

201201
prob = SDEProblem(fadd,gadd,u₀,tspan,p)
202202
ensemble_prob = EnsembleProblem(prob;
203-
output_func = (sol,i) -> (sol[end],false),
203+
output_func = (sol,i) -> (sol.u[end],false),
204204
prob_func = prob_func
205205
)
206206

@@ -233,7 +233,7 @@ gadd!(du,u,p,t) = @.(du = p[2])
233233

234234
prob = SDEProblem(fadd!,gadd!,u₀,tspan,p)
235235
ensemble_prob = EnsembleProblem(prob;
236-
output_func = (sol,i) -> (sol[end][1],false),
236+
output_func = (sol,i) -> (sol.u[end][1],false),
237237
prob_func = prob_func
238238
)
239239

test/weak_convergence/SIE_SME.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ seeds = rand(UInt, numtraj)
3838

3939
prob = SDEProblem(f,g,u₀,tspan,p)
4040
ensemble_prob = EnsembleProblem(prob;
41-
output_func = (sol,i) -> (h1(sol[end]),false),
41+
output_func = (sol,i) -> (h1(sol.u[end]),false),
4242
prob_func = prob_func
4343
)
4444

@@ -90,7 +90,7 @@ p = [3//2,1//100]
9090

9191
prob = SDEProblem(f1!,g1!,u₀,tspan,p)
9292
ensemble_prob = EnsembleProblem(prob;
93-
output_func = (sol,i) -> (h1(sol[end][1]),false),
93+
output_func = (sol,i) -> (h1(sol.u[end][1]),false),
9494
prob_func = prob_func
9595
)
9696

@@ -155,7 +155,7 @@ h3(z) = z^2 # == 1//10**exp(3//2*t) if h3(z) = z and == 1//100**exp(301//100*t)
155155

156156
prob = SDEProblem(f3!,g3!,u₀,tspan)
157157
ensemble_prob = EnsembleProblem(prob;
158-
output_func = (sol,i) -> (h3(sol[end][1]),false),
158+
output_func = (sol,i) -> (h3(sol.u[end][1]),false),
159159
prob_func = prob_func
160160
)
161161

test/weak_convergence/W2Ito1.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ seeds = rand(UInt, numtraj)
3838

3939
prob = SDEProblem(f, g, u₀, tspan)
4040
ensemble_prob = EnsembleProblem(prob;
41-
output_func=(sol, i) -> (h1(asinh(sol[end])), false),
41+
output_func=(sol, i) -> (h1(asinh(sol.u[end])), false),
4242
prob_func=prob_func
4343
)
4444

@@ -67,7 +67,7 @@ h2(z) = z^2 # == 1//10**exp(3//2*t) if h3(z) = z and == 1//100**exp(301//100*t)
6767

6868
prob = SDEProblem(f2, g2, u₀, tspan)
6969
ensemble_prob = EnsembleProblem(prob;
70-
output_func=(sol, i) -> (h2(sol[end][1]), false),
70+
output_func=(sol, i) -> (h2(sol.u[end][1]), false),
7171
prob_func=prob_func
7272
)
7373

@@ -101,7 +101,7 @@ h3(z) = z^2 # but apply it only to u[1]
101101

102102
prob = SDEProblem(f3, g3, u₀, tspan, noise_rate_prototype=zeros(2, 2))
103103
ensemble_prob = EnsembleProblem(prob;
104-
output_func=(sol, i) -> (h3(sol[end][1]), false),
104+
output_func=(sol, i) -> (h3(sol.u[end][1]), false),
105105
prob_func=prob_func
106106
)
107107

@@ -136,7 +136,7 @@ h1(z) = z^3 - 6 * z^2 + 8 * z
136136

137137
prob = SDEProblem(f1!, g1!, u₀, tspan)
138138
ensemble_prob = EnsembleProblem(prob;
139-
output_func=(sol, i) -> (h1(asinh(sol[end][1])), false),
139+
output_func=(sol, i) -> (h1(asinh(sol.u[end][1])), false),
140140
prob_func=prob_func
141141
)
142142

@@ -171,7 +171,7 @@ h2(z) = z^2 # == 1//10**exp(3//2*t) if h3(z) = z and == 1//100**exp(301//100*t)
171171

172172
prob = SDEProblem(f2!, g2!, u₀, tspan)
173173
ensemble_prob = EnsembleProblem(prob;
174-
output_func=(sol, i) -> (h2(sol[end][1]), false),
174+
output_func=(sol, i) -> (h2(sol.u[end][1]), false),
175175
prob_func=prob_func
176176
)
177177

test/weak_convergence/srk_weak_diagonal_final.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ h3(z) = z^2 # == 1//10**exp(3//2*t) if h3(z) = z and == 1//100**exp(301//100*t)
3737

3838
prob = SDEProblem(f3!,g3!,u₀,tspan)
3939
ensemble_prob = EnsembleProblem(prob;
40-
output_func = (sol,i) -> (h3(sol[end][1]),false),
40+
output_func = (sol,i) -> (h3(sol.u[end][1]),false),
4141
prob_func = prob_func
4242
)
4343

0 commit comments

Comments
 (0)