SciML / SymbolicIndexingInterface.jl

A general interface for symbolic indexing of SciML objects used in conjunction with Domain-Specific Languages
https://docs.sciml.ai/SymbolicIndexingInterface/stable/
MIT License
14 stars 6 forks source link

`getu` seems broken for `ArraySymbolic` #95

Open hexaeder opened 1 month ago

hexaeder commented 1 month ago

If getu(sys, sym::ArraySymbolic) with an ArraySymbolic, sym used to be collected. Now, it resolves the indices, idx = variable_indices(sys, sym) which, in my case, returns something like Int[1,2]. However this ends up as some _getp call

https://github.com/SciML/SymbolicIndexingInterface.jl/blob/82f1464e47c87ec402d0f368c091cb5232d9c07f/src/state_indexing.jl#L242-L245

because sym_arr = [1,2] which is neither variable nor parameter of my inpr thus the timeseries idx do not contain ContinuousTimeseries().

Can be solved if get_all_timeseries_indexes(inpr, sym) returns Set([SII.ContinuousTimeseries()]) for random inputs (in this case: integers). But does this really make sense? For example, that's not how it is defined in SymbolCache, which just returns an empty set.

https://github.com/SciML/SymbolicIndexingInterface.jl/blob/82f1464e47c87ec402d0f368c091cb5232d9c07f/src/symbol_cache.jl#L141-L149