-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove
eval
s from model parsing
- Ensure that modules consisting MTKModels with component arrays and icons of `Expr` type and `unit` metadata can be precompiled.
- Loading branch information
Showing
3 changed files
with
41 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module ModelParsingPrecompile | ||
|
||
using ModelingToolkit | ||
using Unitful | ||
|
||
@mtkmodel ModelWithComponentArray begin | ||
@parameters begin | ||
R(t)[1:3] = 1, [description = "Parameter array", unit = u"Ω"] | ||
end | ||
end | ||
|
||
@mtkmodel ModelWithExprIcon begin | ||
@icon read(abspath(@__DIR__, "..", "icons", "ground.svg"), String) | ||
end | ||
|
||
end |