Skip to content

Commit

Permalink
test: re-enable plotting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jul 24, 2024
1 parent 9313061 commit 5b77acd
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions test/downstream/integrator_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ p = [lorenz1.σ => 10.0,
tspan = (0.0, 100.0)
prob = ODEProblem(sys, u0, tspan, p)
integrator = init(prob, Rodas4())
sol = solve(prob, Rodas4())
step!(integrator, 100.0, true)

@test_throws Any integrator[b]
Expand Down Expand Up @@ -318,14 +319,30 @@ integrator[lorenz2.x] = 2.0
# integrator10 = integrator(0.1, idxs = 2)
# @test integrator10 isa Real

#=
using Plots
plot(sol,idxs=(lorenz2.x,lorenz2.z))
plot(sol,idxs=(α,lorenz2.z))
plot(sol,idxs=(lorenz2.x,α))
plot(sol,idxs=α)
plot(sol,idxs=(t,α))
=#
for idxs in [
(lorenz2.x,lorenz2.z),
(α,lorenz2.z),
(lorenz2.x,α),
α,
(α,),
(t,α),
[lorenz2.x,lorenz2.z],
[α,lorenz2.z],
[lorenz2.x,α],
[α],
[t,α],
]
plot(sol, idxs)
if idxs isa Union{Tuple, AbstractArray}
idxs = map(idx) do i
hasname(i) ? getname(i) : i
end
plot(sol, idxs)
elseif hasname(idxs)
plot(sol, idxs=getname(idxs))
end
end

using LinearAlgebra
sts = @variables x(t)[1:3]=[1, 2, 3.0] y(t)=1.0
Expand Down

0 comments on commit 5b77acd

Please sign in to comment.