-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from DARPA-ASKEM/feature/decapodes-reset
Add decapode reset message handler
- Loading branch information
Showing
4 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
src/askem_beaker/contexts/decapodes/procedures/julia/load_model.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
using ACSets, Decapodes, SyntacticModels | ||
import HTTP, JSON3, DisplayAs | ||
_amr = JSON3.read(String(HTTP.get("{{ model_url }}").body), SyntacticModels.ASKEMDecapodes.ASKEMDecaExpr) | ||
{{ var_name|default("model") }} = Decapodes.SummationDecapode(_amr.model) | ||
Dict(["var_name" => "{{ var_name|default("model") }}"]) |> DisplayAs.unlimited ∘ JSON3.write # TODO: Fix 'Unable to parse result' false error | ||
{% for var_name, definition in variables.items() %} | ||
{{ var_name }} = parse_json_acset(SummationDecapode{Symbol, Symbol, Symbol},"""{{ definition }}""") | ||
_model_reset_cache[:{{ var_name }}] = {{ var_name }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ var_name|default("decapode") }} = (haskey(_model_reset_cache, :{{ var_name|default("decapode") }}) ? _model_reset_cache[:{{ var_name|default("decapode") }}] : @decapode begin end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters