-
Notifications
You must be signed in to change notification settings - Fork 156
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
get_variables
doesn't work for function arguments
#1351
Comments
I guess maybe this should actually return [p_1(t, x(t)), x, t], because both the function parameter and its arguments are variables in this case? |
Hi, just checking in on this. Are there any thoughts about how it could be resolved? Thanks for any suggestions you can offer! |
Thanks for pinging again. This got buried under other tasks, but it should be easy to do. I'll work on it ASAP |
Thanks! |
I think what you need is |
I didn't know that existed. Yeah, it needs an update, thanks for pointing it out. MTK's variable searching semantics are different from plain Symbolics. |
After a lot of deliberation, it seems the best solution is your original suggestion of updating |
As an aside; I'd appreciate a ping on any PRs trying to change the dependency graph code (like |
Describe the bug 🐞
I have a problem where the function
ModelingToolkit.varvar_dependencies
is not returning the correct dependencies, and I have tracked it down to an issue where the functionSymbolics.get_variables
is not working correctly for function arguments.Expected behavior
I would expect
Symbolics.get_variables
to return any variables included in a function call, so thatModelingToolkit.varvar_dependencies
returns the correct dependencies.Minimal Reproducible Example 👇
** Potential fix**
If I implement this workaround, then it works as expected in my case:
However, I'm not confident that this fix doesn't break anything else.
Error & Stacktrace⚠️
There is no error, it just doesn't return the correct dependencies.
Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
The text was updated successfully, but these errors were encountered: