diff --git a/src/compat/scimlbase.jl b/src/compat/scimlbase.jl index 7fc47c0b..167a3959 100644 --- a/src/compat/scimlbase.jl +++ b/src/compat/scimlbase.jl @@ -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 diff --git a/test/diffeq_test/diffeq_tests.jl b/test/diffeq_test/diffeq_tests.jl index 01f35c61..60b7b1c2 100644 --- a/test/diffeq_test/diffeq_tests.jl +++ b/test/diffeq_test/diffeq_tests.jl @@ -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 \ No newline at end of file