-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON ACSetTransformations #865
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me except for the white space question.
Test file passes when ran via |
I'm fine if you want to merge this as-is (once all the CI is passing) as long as you are OK with me possibly revisiting the API later once I have more time. |
Certainly. I tried to follow the serialization scheme set forth in ACSets.jl, but I am sure that there are improvements to be made both to this code and where it lives. ACSets.jl has a |
I have just marked this PR as ready to review. I made one change to parsing that explicitly checks whether the mapping in a julia> FinFunction(1:0, 0, 4)
FinFunction(1:0, 0, 4)
julia> FinFunction([], 0, 4)
ERROR: MethodError: no method matching (SetFunction{Dom, Codom} where {S, S′, Dom<:(FinSet{S}), Codom<:(FinSet{S′})})(::Vector{Any}, ::Int64, ::Int64) |
Review ChecklistDoes this PR follow the development guidelines? Following is a partial checklist: Tests
Documentation
Other
|
Currently, ACSets.jl supports serialization of ACSets to JSON to export ACSets to other languages that support complementary parsers.
Due to new features in Decapodes being encoded as ACSetTransformations, and these features needing to be exported across systems, the JSON serialization of ACSetTransformations should be supported. The serialization of ACSetTransformations being generic, this serialization should be upstreamed to Catlab rather than stay in the Decapodes library.
So, this PR adds support for the serialization of ACSetTransformations to JSON. Incidentally, FinFunction serialization is also supported.
The
generate
-parse
&write
-read
interface is copied from the pattern for serialization currently used by ACSets.jlSupport for
VarFunctions
is outside of the current scope of this PR, and so an issue should be created pending merge of this PR that adds such support.