Open djinnome opened 11 months ago
It may work with the new models; I'll have a look.
OK, on advice from @jpfairbanks , I tried: https://github.com/AlgebraicJulia/StockFlow.jl/blob/master/docs/src/json.md
Interestingly, when I ran:
JSON3.pretty(generate_json_acset(sir))
I got:
{
"Flow": [
{
"u": 1,
"d": 2,
"fname": "NewIncidence",
"ϕf": "p.cβ*u.S*u.I/p.N"
},
{
"u": 2,
"d": 3,
"fname": "NewRecovery",
"ϕf": "u.I/p.tr"
}
],
"Stock": [
{
"sname": "S"
},
{
"sname": "I"
},
{
"sname": "R"
}
],
"Link": [
{
"s": 1,
"t": 1
},
{
"s": 2,
"t": 1
},
{
"s": 2,
"t": 2
}
]
}
but when I tried:
open("sir.json", "w") do io
JSON3.pretty(io, generate_json_acset(sir))
end
I got an empty sir.json
file.
The only explanation I could see for the empty file is not flushing the file handle. Did you end the julia process before looking at the file?
Hi folks,
I tried serializing the StockFlow acset examples in https://github.com/AlgebraicJulia/StockFlow.jl/blob/master/examples/primitive_schema_examples/Covid19_composition_model_in_paper.ipynb
to json with:
But I got this error instead:
I got the same error with Vaccine model B, Persistent Asymptomaticity Model C, and the COVID19 model.