-
Notifications
You must be signed in to change notification settings - Fork 4
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
WIP update to use InterTypes #29
Conversation
… a corresponding test script intertype_examples.jl
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
==========================================
+ Coverage 81.74% 87.11% +5.37%
==========================================
Files 6 6
Lines 378 489 +111
==========================================
+ Hits 309 426 +117
+ Misses 69 63 -6 ☔ View full report in Codecov by Sentry. |
…amr.it version. Changed amr module name to AMR.
…ith jsonread and jsonwrite
…ted the uwd intertypes.
…model and readback in core_it.jl. readback currently won't work because intertypes parsing doesn't recognize the typeof variant sum types.
…. Can now construct from an intertype version of DecaExpr. Still need to add SummationDecapode schema so it can be a field type for an ASKEMDecapode.
…type module but the SummationDecapode formation function is not yet producing an intertype one.
…r uses Decapodes.jl. Copied in a few utilities from there. Edited readback function in core_it.jl
…pdating the module and runtest files accordingly. Had to change the amr.it name within uwd.it from AMR to amr.
…me to amr. Changed my_parse_decapode function name as well.
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.
The unnecessary rename of these file makes the diffs unreviewable. Please put them back and confirm that the diffs are useful. I can review again at that time.
|
||
[compat] | ||
ACSets = "0.2" | ||
Catlab = "0.15, 0.16" | ||
Decapodes = "0.5" | ||
Decapodes = "0.4, 0.5" |
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.
Since code is moved here, do we still need to depend on Decapodes?
src/amr_it.jl
Outdated
@@ -0,0 +1,391 @@ | |||
module AMR |
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.
because of the rename of this file, the diff is useless. See above comment.
src/amr_it.jl
Outdated
using ACSets.ACSetInterface | ||
using StructTypes | ||
|
||
# using ..SyntacticModelsBase |
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.
Delete commented out code
src/amr_it.jl
Outdated
return Base.Meta.parse(distro_string(d)) | ||
end | ||
|
||
#= |
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.
delete block comments.
src/composite_models_it.jl
Outdated
@@ -0,0 +1,85 @@ | |||
module Composites |
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.
again, I can't review this diff because of the file rename.
src/decapodes_it.jl
Outdated
using ..AMR | ||
|
||
using StructTypes | ||
# using Decapodes |
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.
is anything using Decapodes now that you copied code over here? Should we upgrade Decapodes to use InterTypes and then just use InterType inteheritance here?
src/decapodes_it.jl
Outdated
return d | ||
end | ||
|
||
function recognize_types(d::decapodes.AbstractNamedDecapode) |
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.
Should SynacticModels be doing decapodes operations like recognize_types
? What do you think the scope boundary is?
src/decapodes_it.jl
Outdated
end | ||
end | ||
|
||
function parse_decapode(expr::Expr) |
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.
Should SynacticModels be doing decapodes operations like parse_decapode
? What do you think the scope boundary is?
src/uwd_it.jl
Outdated
@@ -0,0 +1,191 @@ | |||
module ASKEMUWDs |
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.
I can't review this diff because the file was renamed unnecessarily.
… is not yet working; some possibly needed upstream Decapodes and Catlab functions are copied into src and parts of test are commented out.
…to finish the functionality in amr. Copied in commented version of old example code into test.
…riginal files for easier diff view.
… files for difference viewing.
I've updated the file names for the PR, and the diffs look ok now. Regarding the included decapodes functions, I think the longer-term plan is for Decapodes and other structures to be defined directly upstream with InterTypes. But for the short-term, it seemed easier to develop locally within SyntacticModels. I do think it would be helpful to have a discussion about the design/scope plan for SyntacticModels because it relates to the current points of development for the AMR and Composites functionality as well. |
src/uwd.jl
Outdated
varname(v::Var) = @match v begin | ||
Untyped(v) => v | ||
Typed(v, t) => v | ||
varname(v::uwd.Var) = @match v begin |
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.
@p-stokes, is there a problem with doing
const Var = uwd.Var
and then not needing to do all these qualified names?
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.
Even that might not really be necessary. It might be possible to just use Var
in this case. I'll check.
The qualification of names was somewhat inconsistent as I was developing, so I do plan to go through and do a standardization once the functionality is set.
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.
I've cleaned up the name qualifications.
using Test | ||
using OrderedCollections | ||
import JSON | ||
import JSON3 |
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.
What functionality are you using from all these additional imports?
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.
Similar to the name qualifications, I was a bit lax with the imports during development.
I have already begun going through and cleaning up some of the unnecessary imports.
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.
I've cleaned up the imports.
test/composite_models_examples.jl
Outdated
|
||
|
||
|
||
h = AMR.Header("harmonic_oscillator", | ||
h = Header("","harmonic_oscillator", |
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.
The fields of the Header are changing?
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.
In the Model-Representations repo, I noticed Five had added an extra id
field to the Header
there, so I incorporated it here. I can go through and take it out if you want?
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.
That upgrade for compatibility with Model-Representations should be a separate issue and PR because it is not related to "update to use InterTypes"
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.
Ok. I'll undo that and make a separate issue and PR after.
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.
I've removed the id
field.
src/composite_models.jl
Outdated
|
||
using MLStyle | ||
using Catlab | ||
using Decapodes | ||
using Decapodes # : SummationDecapode |
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.
if you don't need it delete the import.
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.
It was deleted in the imports cleanup.
…ved references to Decapodes.jl in decapodes.jl.
I cleaned up and standardized the imports and name qualifications. Still working on the remaining composite |
I think the first part of that discussion is understanding your expectations for the scope. What are your thoughts? |
element::Vector{Args} | ||
end | ||
|
||
#= |
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.
do we need this?
@@ -0,0 +1,102 @@ | |||
|
|||
@sum Args begin |
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.
Is this being copied from https://github.com/AlgebraicJulia/ACSets.jl/blob/main/src/ADTs.jl#L14?
We should upgrade that code to use InterTypes and then import that usage here.
Summarizing our in-person discussion about this: |
…e new PR to add later if needed.
…decapode to a Decapodes one, then Decapodes.Open can be used to compose. Still need to add reverse conversion.
… Updated remaining OpenDecapode function to oapply composite model and convert back to intertype.
… uses in examples. jsonwrite in first method still not working for empty annotations, so those examples are still commented.
… needed to make write_json_model and readback work.
…es in .it as needed. Load to AMR from expression examples now work. Need to update amr_to_string (and check other functions) to match current intertypes.
…eNode. Need to update load from dict for ASKEModel and Typing and amr_to_string.
…s of Strings for some examples. Also still need to fix amr_to_string and amr_to_expr.
…relates to intertype version of ACSetSpec is different format from ADTs. May want to convert back for expr or string. amr_to_string runs but doesn't look good.
Some of the work here ends up duplicating work merged into DiagrammaticEquations, so it makes sense to make a new PR |
This is to make the InterType form of the various structures currently in SyntacticModels.
Resolves #28