Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/compat/scimlbase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

# Plotting stuff
function SciMLBase.getsyms(sol::SciMLBase.AbstractODESolution{T,N,C}) where {T,N,C<:AbstractVector{<:ComponentArray}}
# if SciMLBase.has_syms(sol.prob.f)
# return sol.prob.f.syms
# else
# return labels(sol.u[1])
# end
keys(sol.prob.u0)
if SciMLBase.has_syms(sol.prob.f)
return sol.prob.f.syms
else
return labels(sol.u[1])
end
end

# A little bit of type piracy. Should probably make this a PR to DiffEqBase
Expand Down
19 changes: 0 additions & 19 deletions test/diffeq_test/diffeq_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,4 @@ end
@test (ctime - time)/time < 0.1
@test (ctime - ltime)/ltime < 0.05
end
end

@testset "symbolic-indexing" begin
function lotka!(D, u, p, t; f=0)
@unpack α, β, γ, δ = p
@unpack x, y = u

D.x = α*x - β*x*y
D.y = -γ*y + δ*x*y
return nothing
end

lotka_p = (α=2/3, β=4/3, γ=1.0, δ=1.0)
lotka_ic = ComponentArray(x=1.0, y=1.0)
tspan = (0.0,10.0)
lotka_prob = ODEProblem(lotka!, lotka_ic, tspan, lotka_p)
sol = solve(lotka_prob, Tsit5(), saveat=1.0)
@test length(sol[:x]) == 11
@test typeof(sol[:x]) == Vector{Float64}
end