-
-
Notifications
You must be signed in to change notification settings - Fork 71
Add new interface for symbolic indexing #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- DiffEqArray now stores the new `SymbolCache` struct, which defines and implements its interface to query symbols - DiffEqArray supports symbolically indexing parameters, if provided
|
This gets a little annoying due to the compatibility with the old route: ends up constructing a |
- SymbolCache and interface functions added and exported - `states`, `parameters` and `independent_variables` hoisted down from MTK
- DiffEqArray constructs SymbolCache taking into account if `indepsym` is `nothing`, a single symbol or an `AbstractArray` of symbols - Test symbolic indexing functionality
- `symbolic_indexing_interface.jl` moved to its own package - Update tests accordingly
|
There is one major downside here: to avoid breaking changes, the constructors for DiffEqArray have been modified to work the same way they did before. However, this makes it so that trying to construct a DiffEqArray with a system requires specifying type parameters: DiffEqArray(u, t, syms, indepsym, observed, p) # works as it did before
DiffEqArray(u, t, sys, observed, p) # interprets sys as syms, observed as indepsym and p and observed
DiffEqArray{..., typeof(sys), typeof(observed), typeof(p)}(u, t, sys, observed, p) # worksAlso, to specify paramsyms (without a system) sc = SymbolCache(syms, indepsym, paramsyms)
DiffEqArray{..., typeof(sc), typeof(observed), typeof(p)}(u, t, sc, observed, p) |
|
That's a fine wart for now. Open an issue to deprecate that in the next breaking update. |
SymbolCachestruct, which defines and implements its interface to query symbolsSee SciML/ModelingToolkit.jl#1988
All tests pass as-is (except GPU, which I haven't been able to run locally), so this shouldn't be breaking. The constructors are modified to have the same interface but create the new structures