Commit 39c3708
committed
Route
`sol[arr_sym, :]` should be equivalent to `sol[arr_sym]` — both ask for
the full timeseries of the symbolic indices. Currently the `:`-suffixed
form errors with a broadcast shape mismatch inside SII's `GetStateIndex`
when the underlying index resolves to a `Vector{Int}` (i.e. when the
symbol is array-valued like `x(t)[1:3]`):
DimensionMismatch: arrays could not be broadcast to a common size:
a has axes Base.OneTo(N) and b has axes Base.OneTo(K)
(SII's `(gsi::GetStateIndex)(::Timeseries, prob, i)` broadcasts `gsi.idx`
against `state_values(prob, i)` without wrapping it in a 1-tuple, so a
length-N timeseries broadcast against a length-K idx vector errors. A
companion fix is being submitted upstream.)
Short-circuiting `A[sym, :]` to `A[sym]` here both restores the intended
semantics and avoids the broken SII codepath.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>A[sym, :] through A[sym] for symbolic indices1 parent 2c2e5ec commit 39c3708
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
800 | 809 | | |
801 | 810 | | |
802 | 811 | | |
| |||
0 commit comments