Open jpfairbanks opened 1 year ago
(Assuming that the example was supposed to have g
and h
being WeightedGraphs rather than Graphs)
The stack trace involved doesn't seem to involve any Catlab code. Do you know what method would need to be changed/added for VarFunction{T}
to avoid this problem? (So far I've tried Base.show
without any effect)
Oh yeah, I copied the minimal working example instead of the minimal breaking one. You would just have to overload JSON.json
Catlab doesn't actually use JSON
anywhere (it's only in the test Project.toml) so I don't think that can be responsible for the difference between FinFunctions and VarFunctions
Wait, is this about using JSON.json
to serialize structs (in this case, the structs for FinFunctions or VarFunctions) using the default serialization? IMO, we should not be doing that since, as this issue shows, it's too general to be reliable or invertible. We should decide on the format, then implement the serializers and deserializers ourselves.
Cf. https://github.com/AlgebraicJulia/ACSets.jl/issues/28, which I was planning to resolve before the next release.
Among the Topos folks we've started to discuss possibilities for a more systematic and less piecemeal approach to serialization, but that's a much bigger topic that should not detract from getting workable solutions in the short term.
Yes, finfunctions just work because they are structs with serializable fields. I guess we should collect them manually to make things work in the short term.
What are some of the ideas about long term serialization?
FinFunctions are just simple structs so they serialize just fine, but VarFunctions (even empty ones) don't serialize.
MWE: