diff --git a/src/amr.it b/src/amr.it index b5ead00..f9aa5a2 100644 --- a/src/amr.it +++ b/src/amr.it @@ -15,12 +15,12 @@ end @sum Distribution begin - StandardUniform(str::String) + StandardUniform() Uniform(min::Float64, max::Float64) - StandardNormal(str::String) + StandardNormal() Normal(mean::Float64, variance::Float64) PointMass(value::Float64) - Undefined(str::String) + Undefined() end struct Observable @@ -37,11 +37,6 @@ end Time(id::Symbol, units::Unit) end -struct Pair - first::Symbol - second::Symbol -end - @sum Note begin Name(str::String) Description(str::String) diff --git a/src/amr.jl b/src/amr.jl index b3f0ec0..e698c99 100644 --- a/src/amr.jl +++ b/src/amr.jl @@ -19,7 +19,6 @@ using ..SyntacticModelsBase @intertypes "amr.it" module amr end using .amr -import .amr: Pair nomath = Math("") @@ -28,7 +27,7 @@ nounit = Unit("", nomath) @data Semantic <: AbstractTerm begin ODEList(statements::Vector{Expression}) ODERecord(rates::Vector{Rate}, initials::Vector{Initial}, parameters::Vector{Parameter}, time::Time) - Typing(system::ACSetSpec, map::Vector{Pair}) + Typing(system::ACSetSpec, map::Vector{Base.Pair}) end @@ -189,8 +188,8 @@ end function load(::Type{Distribution}, d::AbstractDict) @match d begin - Dict("type"=>"StandardUniform1") => StandardUniform - Dict("type"=>"StandardNormal") => StandardNormal + Dict("type"=>"StandardUniform1") => StandardUniform() + Dict("type"=>"StandardNormal") => StandardNormal() Dict("type"=>"Uniform", "parameters"=>p) => Uniform(p["minimum"], p["maximum"]) Dict("type"=>"Uniform1", "parameters"=>p) => Uniform(p["minimum"], p["maximum"]) Dict("type"=>"Normal", "parameters"=>p) => Normal(p["mu"], p["var"]) @@ -198,7 +197,7 @@ function load(::Type{Distribution}, d::AbstractDict) end end -load(::Type{Distribution}, ::Nothing) = PointMass(missing) +load(::Type{Distribution}, ::Nothing) = Undefined() function load(::Type{Note}, d::AbstractDict) @match d begin @@ -221,7 +220,7 @@ function load(::Type{Parameter}, d::AbstractDict) u, d["value"], load(Distribution, get(d,"distribution", nothing)) - ) + ) end function load(::Type{ODERecord}, d::AbstractDict) diff --git a/src/askemdecapodes.it b/src/askemdecapodes.it index 01d68dc..df3f910 100644 --- a/src/askemdecapodes.it +++ b/src/askemdecapodes.it @@ -1,4 +1,4 @@ @sum ASKEMDeca begin - ASKEMDecaExpr(header::amr.Header, model::decapodes.DecaExpr, annotations::Vector{amr.Annotation{Symbol,Symbol}}) - ASKEMDecapode(header::amr.Header, model::decapodes.SummationDecapode, annotations::Vector{amr.Annotation{Symbol,Symbol}}) + ASKEMDecaExpr(header::amr.Header, model::decapodes.DecaExpr, annotations::Vector{amr.Annotation}) + ASKEMDecapode(header::amr.Header, model::decapodeacset.SymSummationDecapode, annotations::Vector{amr.Annotation}) end diff --git a/src/decapodes.jl b/src/decapodes.jl index bd0242b..b6f9753 100644 --- a/src/decapodes.jl +++ b/src/decapodes.jl @@ -18,6 +18,7 @@ import DiagrammaticEquations: decapodes, decapodeacset end using .askemdecapodes +using .askemdecapodes: ASKEMDecaExpr, ASKEMDecapode @doc """ ASKEMDeca diff --git a/test/core.jl b/test/core.jl index 55f9996..a0c1144 100644 --- a/test/core.jl +++ b/test/core.jl @@ -1,7 +1,5 @@ -include("../src/SyntacticModels.jl") - -using .SyntacticModels -using .SyntacticModels.ASKEMDecapodes +using SyntacticModels +using SyntacticModels.ASKEMDecapodes using Test using JSON3 @@ -35,4 +33,4 @@ include("amr_examples.jl") include("decapodes_examples.jl") include("uwd_examples.jl") include("composite_models_examples.jl") -include("serialization_mwe.jl") \ No newline at end of file +include("serialization_mwe.jl")