|
90 | 90 | function Base.getproperty(fs::FakeSolution, s::Symbol)
|
91 | 91 | s === :ps ? ParameterIndexingProxy(fs) : getfield(fs, s)
|
92 | 92 | end
|
| 93 | +SymbolicIndexingInterface.state_values(fs::FakeSolution) = fs.u |
| 94 | +SymbolicIndexingInterface.current_time(fs::FakeSolution) = fs.t |
93 | 95 | SymbolicIndexingInterface.symbolic_container(fs::FakeSolution) = fs.sys
|
94 | 96 | SymbolicIndexingInterface.parameter_values(fs::FakeSolution) = fs.p[end]
|
95 | 97 | SymbolicIndexingInterface.parameter_values(fs::FakeSolution, i) = fs.p[end][i]
|
@@ -149,3 +151,20 @@ for (sym, val, arrval, check_inference) in [
|
149 | 151 | @test get(fs, sub_inds) == arrval[sub_inds]
|
150 | 152 | end
|
151 | 153 | end
|
| 154 | + |
| 155 | +ps = fs.p[2:2:end] |
| 156 | +avals = getindex.(ps, 1) |
| 157 | +bvals = getindex.(ps, 2) |
| 158 | +cvals = getindex.(ps, 3) |
| 159 | +for (sym, val, arrval) in [ |
| 160 | + (:a, p[1], avals), |
| 161 | + ((:b, :c), p[2:3], tuple.(bvals, cvals)), |
| 162 | + ([:c, :a], p[[3, 1]], vcat.(cvals, avals)) |
| 163 | +] |
| 164 | + get = getu(sys, sym) |
| 165 | + @inferred get(fs) |
| 166 | + @test get(fs) == arrval |
| 167 | + for i in eachindex(ps) |
| 168 | + @test get(fs, i) == arrval[i] |
| 169 | + end |
| 170 | +end |
0 commit comments