Skip to content

Commit 32aa2c6

Browse files
fix: handle edge case where sol.u isa Vector{<:Number}
1 parent f75c944 commit 32aa2c6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/solutions/ode_solutions.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ end
172172
function (sol::AbstractODESolution)(t::Number, ::Type{deriv},
173173
idxs::AbstractVector{<:Integer},
174174
continuity) where {deriv}
175+
if eltype(sol.u) <: Number
176+
idxs = only(idxs)
177+
end
175178
sol.interp(t, idxs, deriv, sol.prob.p, continuity)
176179
end
177180
function (sol::AbstractODESolution)(t::AbstractVector{<:Number}, ::Type{deriv},
@@ -183,6 +186,9 @@ end
183186
function (sol::AbstractODESolution)(t::AbstractVector{<:Number}, ::Type{deriv},
184187
idxs::AbstractVector{<:Integer},
185188
continuity) where {deriv}
189+
if eltype(sol.u) <: Number
190+
idxs = only(idxs)
191+
end
186192
A = sol.interp(t, idxs, deriv, sol.prob.p, continuity)
187193
p = hasproperty(sol.prob, :p) ? sol.prob.p : nothing
188194
return DiffEqArray(A.u, A.t, p, sol)

0 commit comments

Comments
 (0)