Skip to content

bump SymbolicIndexingInterface to 0.2 - #1997

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
oscardssmith:patch-2
Dec 13, 2022
Merged

ChrisRackauckas merged 1 commit into
SciML:masterfrom
oscardssmith:patch-2

Conversation

@oscardssmith

Copy link
Copy Markdown
Member

required for SciML/SciMLBase.jl#342

@ChrisRackauckas

Copy link
Copy Markdown
Member

Test failure

@oscardssmith

Copy link
Copy Markdown
Member Author

interestingly it's a test failure that occurred even though the version bump I allowed didn't happen (because it hasn't picked up the new version of RecursiveArrayTools)

@AayushSabharwal

AayushSabharwal commented Dec 13, 2022 •

Copy link
Copy Markdown
Member

This error seems to be because the ODEFunction is passed a Symbol for indepsym, which is passed as the indepsym to DiffEqArray. Then, while indexing it tries to compare the Symbol to a Symbolics.Num (t) and fails, thus searching for t in observed

@AayushSabharwal

Copy link
Copy Markdown
Member

The same test seems to have passed in #1988 because it used RecursiveArrayTools v2.32.3, just before the change there

@AayushSabharwal

AayushSabharwal commented Dec 13, 2022 •

Copy link
Copy Markdown
Member

It seems the issue is that there is no "standard" for storing symbols. Some places store it as Symbol, others as Symbolics.Num. SymbolicIndexingInterface happily takes either and compares them

Basically, with SymbolCache in SymbolicIndexingInterface, it stores Symbols, and compares everything to it. MTK systems, on the other hand, compare everything to Symbolics.Nums. The two don't mix. The best solution I can think of is the following:

  • SymbolicIndexingInterface has a default implementation of *_sym_to_index: state_sym_to_index(store, sym) = findfirst(x -> isequal(Symbol(x), Symbol(sym)), states(store)). This way everything is always compared as Symbols
  • Remove MTK's overload for this method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants