From 7a9aadb4c6af6b05ac692d620005659cf0328f38 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Wed, 29 Nov 2023 17:35:13 +0530 Subject: [PATCH] refactor: fix solution indexing when it isn't a VectorOfArray --- src/solutions/solution_interface.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/solutions/solution_interface.jl b/src/solutions/solution_interface.jl index 8437c73eed..1ee137a752 100644 --- a/src/solutions/solution_interface.jl +++ b/src/solutions/solution_interface.jl @@ -58,6 +58,10 @@ SymbolicIndexingInterface.is_time_dependent(::AbstractNoTimeSolution) = false # TODO make this nontrivial once dynamic state selection works SymbolicIndexingInterface.constant_structure(::AbstractSolution) = true +Base.@propagate_inbounds function Base.getindex(A::AbstractTimeseriesSolution, ::Colon) + return A.u[:] +end + Base.@propagate_inbounds function Base.getindex(A::AbstractNoTimeSolution, sym) if symbolic_type(sym) == ScalarSymbolic() if is_variable(A, sym)