Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to general namespace separator
This is the one place where it's used? Thoguh, does this code need to exist? It seems like it's a separate implementation of SII that is a bit buggy, @TorkelE might be best to just replace with SII?
- Loading branch information
57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be an SII version of this. I asked Aayush if there could be a general function that does this in SII, and he kind of agreed but sounded like there was not and he had other stuff he needed to work on? This one is only really used when
XProblem
s are created, as this is the case whereSymbol
s are not accepted. I agree that, when possible (and maybe it already is), this should probably be moved to SII.57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TorkelE seems like tests are failing now?
57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They fixed one of the things we marked as broken on MTK
57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChrisRackauckas this code has been around since Catalyst 10, significantly predating SII. If SII now provides equivalent functionality I agree we should switch to it, but currently there are a number of places using
symmap_to_varmap
throughout the code and docs so we'd need to spend some time updating.57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it would be good to decide if we are making this change before we release Catalyst V14 since it would be breaking to remove
symmap_to_varmap
since it is a documented API function.57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes should definitely remove it for v14. I'll just merge the fix in anyways for posterity. But @AayushSabharwal is on the case for the replacement.
57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I think we are both happy to make the change.
57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Aayush is working on functions like this, another function which would be useful is a conversion of a pure array to symbolic, i.e. taking
[:X, :Y]
(or(:X, :Y)
) to[X, Y]
(or(X, Y)
). This is used in a couple of cases and would be nice to have a SII function for that (a final case, which I think is only relevant when working with outside packages, is the conversion of a ordered array to a sym map, i.e.[1.0, 2.0, 3.0]
to[X1 => 1.0, X2 => 2.0, X3 => 3.0]
).57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SciML/SymbolicIndexingInterface.jl#84 has an API for turning
Symbol
s to symbolics. MTK will have a better version of the default implementation. Your first requirement would by satisfied by broadcastingname_to_symbolic
. Converting an array of values to a symbolic map is only valid for unknowns (and even then not strictly).57f8605
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversion of arrays of values to symbolic maps only working for unknowns makes sense, agreed.