ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
Improve handling of expression in metadata
Instead of evaluating expression while defining the model, keep it as is and execute while creating an instance of it.
This now works:
@mtkmodel Model begin
@parameters begin
ρ₀
p′
β
end
@variables begin
r(t), [guess = ρ₀*(1 + p′/β)]
end
end
Checklist
- [x] Appropriate tests were added
- [x] Any code changes were done in a way that does not break public API
- [x] All documentation related to code changes were updated
- [x] The new code follows the contributor guidelines, in particular the SciML Style Guide and COLPRAC.
- [x] Any new documentation only uses public API
New tests are added to "Model Parsing" and they pass here.
Test failures are unrelated to this PR.
Documentation had passed for the first commit here. The current failure is CI related and not this PR.
This PR is ready for review.