Skip to content

Commit 36a67bb

Browse files
Fix AbstractDiffEqArray getindex deprecation warnings in tests
Use `.u` to access underlying arrays from DiffEqArray objects returned by solution interpolation before comparison with `≈`, instead of relying on the deprecated `Base.getindex(::AbstractDiffEqArray, ::Int)` method that gets triggered by broadcasting during `isapprox`. Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7ba37a5 commit 36a67bb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

test/integrators/iterator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ end
7676
for (u, t) in TimeChoiceIterator(integrator4, ts)
7777
push!(us, u)
7878
end
79-
@test us integrator4.sol(ts)
79+
@test us integrator4.sol(ts).u
8080
end
8181

8282
@testset "iter" begin

test/interface/save_idxs.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const alg = MethodOfSteps(BS3())
4242
@test sol.u == dde_int.sol.u
4343

4444
## interpolation
45-
@test sol(25:100, idxs = 2) [u[1] for u in sol(25:100, idxs = [2])]
45+
@test sol(25:100, idxs = 2).u [u[1] for u in sol(25:100, idxs = [2]).u]
4646
end
4747

4848
# with keyword argument
@@ -61,7 +61,7 @@ const alg = MethodOfSteps(BS3())
6161
@test sol.u == dde_int.sol.u
6262

6363
# interpolation
64-
@test sol[2, :] dde_int.integrator.sol(sol.t, idxs = 2)
64+
@test sol[2, :] dde_int.integrator.sol(sol.t, idxs = 2).u
6565
end
6666
end
6767

@@ -84,8 +84,8 @@ const alg = MethodOfSteps(BS3())
8484
@test sol2.u == dde_int2.sol.u
8585

8686
# interpolation
87-
@test sol(25:100, idxs = 2) sol2(25:100, idxs = 1)
88-
@test sol(25:100, idxs = [2]) sol2(25:100, idxs = [1])
87+
@test sol(25:100, idxs = 2).u sol2(25:100, idxs = 1).u
88+
@test sol(25:100, idxs = [2]).u sol2(25:100, idxs = [1]).u
8989
end
9090

9191
# scalar index
@@ -109,7 +109,7 @@ const alg = MethodOfSteps(BS3())
109109

110110
# interpolation of solution equals second component of
111111
# interpolation of complete solution
112-
@test sol(25:100, idxs = 2) sol2(25:100, idxs = 1)
112+
@test sol(25:100, idxs = 2).u sol2(25:100, idxs = 1).u
113113
end
114114
end
115115
end

0 commit comments

Comments
 (0)