diff --git a/Project.toml b/Project.toml index c72864c..ba506e1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SymbolicIndexingInterface" uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" authors = ["Aayush Sabharwal and contributors"] -version = "0.3.25" +version = "0.3.26" [deps] Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" diff --git a/src/symbol_cache.jl b/src/symbol_cache.jl index 823783f..5451476 100644 --- a/src/symbol_cache.jl +++ b/src/symbol_cache.jl @@ -130,6 +130,14 @@ function timeseries_parameter_index(sc::SymbolCache, sym) return get(sc.timeseries_parameters, sym, nothing) end end + +for symT in [Any, Expr, AbstractArray] + @eval function get_all_timeseries_indexes( + ::SymbolCache{Nothing, Nothing, Nothing}, ::$symT) + Set([ContinuousTimeseries()]) + end +end + function get_all_timeseries_indexes(sc::SymbolCache, sym) if is_variable(sc, sym) || is_independent_variable(sc, sym) return Set([ContinuousTimeseries()]) diff --git a/test/symbol_cache_test.jl b/test/symbol_cache_test.jl index 23320c4..d4581bc 100644 --- a/test/symbol_cache_test.jl +++ b/test/symbol_cache_test.jl @@ -123,3 +123,8 @@ sc2 = copy(sc) @test sc.variables == sc2.variables @test sc.parameters == sc2.parameters @test sc.independent_variables == sc2.independent_variables + +sc = SymbolCache() +for sym in [1, :a, :(a + b), "foo", [:a, :b], [:(a + b), :c]] + @test only(get_all_timeseries_indexes(sc, sym)) == ContinuousTimeseries() +end