Skip to content

Commit

Permalink
BUG: debugging PR #13
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfairbanks committed Aug 30, 2023
1 parent d654441 commit 8e35f6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/SyntacticModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ include("composite_models.jl")
#-----------------------------------------------------------------------------# Constructors
for T in concrete_subtypes(AbstractTerm)
@eval function $(parentmodule(T)).$(T.name.name)(x::NamedTuple)
args = x[fieldnames($T)]
fields = filter(x -> x != :_type, fieldnames($T))
args = collect(x[fields])
@show args
$(parentmodule(T)).$(T.name.name)(args...)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using JSON3
jsondir = joinpath(@__DIR__, "json")

write_json_model(m, prefix=joinpath(@__DIR__, "json")) = open(joinpath(prefix, "$(m.header.name).json"), "w") do fp
JSON3.pretty(fp, Dict(m))
JSON3.pretty(fp, m)
end

readback(m, prefix=joinpath(@__DIR__, "json")) = open(joinpath(jsondir, "$(m.header.name).json"), "r") do fp
Expand Down

0 comments on commit 8e35f6b

Please sign in to comment.