Skip to content
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

AMR Observables should be optional #169

Closed
mwdchang opened this issue Apr 9, 2024 · 1 comment
Closed

AMR Observables should be optional #169

mwdchang opened this issue Apr 9, 2024 · 1 comment

Comments

@mwdchang
Copy link
Member

mwdchang commented Apr 9, 2024

I suspect the AMR parsing logic expects "observable" fields to be present, but it isn't a necessary part of the AMR. The petrinet part was done in https://github.com/DARPA-ASKEM/sciml-service/pull/145, but it seems for regnet/stockflow the same optional logic need to be applied.

[ Info: 2024-04-09T19:33:16+0000 - 10.244.19.1:45354 - "GET /health HTTP/1.1" 200
┌ Error: ERROR:
│   exception =
│    KeyError: key :observables not found
│    Stacktrace:
│      [1] getindex
│        @ ./dict.jl:498 [inlined]
│      [2] get(obj::JSON3.Object{Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}, key::Symbol)
│        @ JSON3 ~/.julia/packages/JSON3/jSAdy/src/JSON3.jl:87
│      [3] getindex(obj::JSON3.Object{Vector{UInt8}, SubArray{UInt64, 1, Vector{UInt64}, Tuple{UnitRange{Int64}}, true}}, key::Symbol)
│        @ JSON3 ~/.julia/packages/JSON3/jSAdy/src/JSON3.jl:128
│      [4] parse_askem_model(input::JSON3.Object{Vector{UInt8}, Vector{UInt64}}, ::Type{SimulationService.ASKEMStockFlowType{Symbol, Number, Symbol, Number, Union{Nothing, Distributions.Distribution}, Number}})
│        @ SimulationService /sciml-service/src/model_parsers/StockFlow.jl:110
│      [5] amr_get_stockflow(amr::JSON3.Object{Vector{UInt8}, Vector{UInt64}})
│        @ SimulationService /sciml-service/src/operations.jl:21
│      [6] amr_get(amr::JSON3.Object{Vector{UInt8}, Vector{UInt64}}, ::Type{ModelingToolkit.ODESystem})
│        @ SimulationService /sciml-service/src/operations.jl:14
│      [7] modelEquation(::HTTP.Messages.Request, id::String)
│        @ SimulationService /sciml-service/src/SimulationService.jl:227
│      [8] (::Oxygen.Core.var"#44#49"{typeof(SimulationService.modelEquation), Dict{String, DataType}, Vector{String}})(req::HTTP.Messages.Request)
│        @ Oxygen.Core ~/.julia/packages/Oxygen/nCv1h/src/core.jl:510
│      [9] (::HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing})(req::HTTP.Messages.Request)
│        @ HTTP.Handlers ~/.julia/packages/HTTP/1EWL3/src/Handlers.jl:439
│     [10] (::Oxygen.Core.var"#28#31"{HTTP.Messages.Request, HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}})()
@jClugstor
Copy link
Collaborator

#170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants