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

Support symbolic arrays in @mtkmodel #2282

Merged
merged 7 commits into from
Oct 27, 2023
Merged

Conversation

ven-k
Copy link
Member

@ven-k ven-k commented Sep 25, 2023

  • Adds symbolic arrays to @mtkmodel
  • Adds relevant tests and docs
  • Updates syntax of @extend in the docs

@ven-k ven-k force-pushed the vkb/symbolic-arrays branch 3 times, most recently from 5074956 to ccc6935 Compare October 10, 2023 17:10
@ven-k ven-k marked this pull request as ready for review October 10, 2023 17:15
@ven-k ven-k force-pushed the vkb/symbolic-arrays branch from ccc6935 to 491314f Compare October 11, 2023 08:59
@ven-k
Copy link
Member Author

ven-k commented Oct 11, 2023

The test failure is unrelated to this PR; I checked that even master throws the same error.

@ven-k ven-k force-pushed the vkb/symbolic-arrays branch 2 times, most recently from 442cba7 to 6520fd0 Compare October 19, 2023 11:24
@ven-k
Copy link
Member Author

ven-k commented Oct 23, 2023

Model Parsing tests pass for Julia 1.61

Footnotes

  1. https://github.com/SciML/ModelingToolkit.jl/actions/runs/6611821413/job/17956475971?pr=2282

var = if indices === nothing
Symbolics.variable(a, T = SymbolicUtils.FnType{Tuple{Real}, Real})(iv)
else
vd[a][:length] = lastindex(indices)
Copy link
Member

@YingboMa YingboMa Oct 23, 2023

Choose a reason for hiding this comment

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

This won't work for general arrays. Shouldn't it be size?

Copy link
Member Author

@ven-k ven-k Oct 25, 2023

Choose a reason for hiding this comment

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

As we use Unitranges here, it uses lastindex; but yeah for general arrays that should be broadcasted.

And I've added tests for general arrays; and renamed :length as :size

@ven-k ven-k force-pushed the vkb/symbolic-arrays branch from c9b8eb3 to af0a95e Compare October 25, 2023 17:59
@ven-k
Copy link
Member Author

ven-k commented Oct 27, 2023

Bump

@YingboMa YingboMa merged commit 397f518 into SciML:master Oct 27, 2023
27 of 33 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.

2 participants