Skip to content
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

Enable the creation of variables using @variables X(vec...) #1365

Merged

Conversation

TorkelE
Copy link
Contributor

@TorkelE TorkelE commented Nov 17, 2024

This enables:

@variables x y z
args = [x, y, z]
@variables X(args...)

which is equivalent to

@variables X(x, y, z)

Currently, the former throws an error. This should enable people to collect e.g. independent variables in a vector, and then using it as dependencies in @variables. This will also fix a problem in Catalyst where we no longer can creat observables correctly.

v1 = only(@variables X(x, y, z, v, w))
v2 = only(@variables X([v for v in [args3; [v, w]]]...))
@test isequal(v1, v2)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uncertain if this is the correct test file, but the best one I found. happy to move elsewhere/create a new file.

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.00%. Comparing base (5af597a) to head (7417bfe).
Report is 26 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1365       +/-   ##
===========================================
+ Coverage    3.98%   79.00%   +75.02%     
===========================================
  Files          50       51        +1     
  Lines        4771     4882      +111     
===========================================
+ Hits          190     3857     +3667     
+ Misses       4581     1025     -3556     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisRackauckas ChrisRackauckas merged commit 0164e00 into JuliaSymbolics:master Nov 17, 2024
10 of 12 checks passed
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