Skip to content

Commit c834a31

Browse files
Merge pull request #89 from SciML/as/hotfix
fix: default to ContinuousTimeseries for symbol not in `SymbolCache`
2 parents 6406219 + 6500eb0 commit c834a31

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SymbolicIndexingInterface"
22
uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
33
authors = ["Aayush Sabharwal <[email protected]> and contributors"]
4-
version = "0.3.25"
4+
version = "0.3.26"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

src/symbol_cache.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ function timeseries_parameter_index(sc::SymbolCache, sym)
130130
return get(sc.timeseries_parameters, sym, nothing)
131131
end
132132
end
133+
134+
for symT in [Any, Expr, AbstractArray]
135+
@eval function get_all_timeseries_indexes(
136+
::SymbolCache{Nothing, Nothing, Nothing}, ::$symT)
137+
Set([ContinuousTimeseries()])
138+
end
139+
end
140+
133141
function get_all_timeseries_indexes(sc::SymbolCache, sym)
134142
if is_variable(sc, sym) || is_independent_variable(sc, sym)
135143
return Set([ContinuousTimeseries()])

test/symbol_cache_test.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,8 @@ sc2 = copy(sc)
123123
@test sc.variables == sc2.variables
124124
@test sc.parameters == sc2.parameters
125125
@test sc.independent_variables == sc2.independent_variables
126+
127+
sc = SymbolCache()
128+
for sym in [1, :a, :(a + b), "foo", [:a, :b], [:(a + b), :c]]
129+
@test only(get_all_timeseries_indexes(sc, sym)) == ContinuousTimeseries()
130+
end

0 commit comments

Comments
 (0)