-
-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Description
Is your feature request related to a problem? Please describe.
We currently use system metadata for a number of different purposes, for example here. We would also like to use the DSL to define models, but currently (as far as I can tell) the DSL doesn't allow specifying system metadata.
Describe the solution you’d like
If it is already possible to specify metadata, I guess just clearer documentation of that feature would be useful. Otherwise, maybe a design something like this:
using ModelingToolkit
using ModelingToolkit: t
using Test
struct TestMeta1 end
struct TestMeta2 end
@mtkmodel ModelA begin
@description "A component with parameters `k` and `k_array` and some metadata."
@parameters begin
k
k_array[1:2]
end
@metadata Dict(
TestMeta1 => "test1",
TestMeta2 => "test2"
)
end
sys = ModelA()
@test getmetadata(sys, TestMeta1) == "test1"
@test getmetadata(sys, TestMeta2) == "test2"
Metadata
Metadata
Assignees
Labels
No labels