DARPA-ASKEM / terarium

https://app.terarium.ai
Apache License 2.0
13 stars 2 forks source link

[BUG]: Sciml latex conversion failing part 2 #4100

Open bigglesandginger opened 1 month ago

bigglesandginger commented 1 month ago

Describe the issue

Step 2.3 fails with a message about LaTeX failing, and the following is logged in sciml.

Error on sciml-service logs

[ Info: 2024-07-11T18:10:43+0000 - 10.244.9.1:59580 - "GET /health HTTP/1.1" 200
[ Info: amr_get ODESystem
Entity: line 1: parser error : Premature end of data in tag apply line 1
<apply><plus/><ci>I</ci><ci>R</ci>
                                  ^
┌ Error: ERROR:
│   exception =
│    unknown error of libxml2
│    Stacktrace:
│      [1] error(s::String)
│        @ Base ./error.jl:35
│      [2] throw_xml_error()
│        @ EzXML ~/.julia/packages/EzXML/DL8na/src/error.jl:77
│      [3] macro expansion
│        @ ~/.julia/packages/EzXML/DL8na/src/error.jl:52 [inlined]
│      [4] parsexml(xmlstring::String; options::@Kwargs{})
│        @ EzXML ~/.julia/packages/EzXML/DL8na/src/document.jl:114
│      [5] parsexml
│        @ ~/.julia/packages/EzXML/DL8na/src/document.jl:109 [inlined]
│      [6] parse_str(str::String)
│        @ MathML ~/.julia/packages/MathML/QfXtx/src/parse.jl:11
│      [7] amr_get_petrinet(amr::JSON3.Object{Vector{UInt8}, Vector{UInt64}})
│        @ SimulationService /sciml-service/src/operations.jl:78
│      [8] amr_get(amr::JSON3.Object{Vector{UInt8}, Vector{UInt64}}, ::Type{ModelingToolkit.ODESystem})
│        @ SimulationService /sciml-service/src/operations.jl:12
│      [9] modelEquation(::HTTP.Messages.Request, id::String)
│        @ SimulationService /sciml-service/src/SimulationService.jl:228
│     [10] #5
│        @ ~/.julia/packages/Oxygen/LWjgB/src/handlers.jl:36 [inlined]
│     [11] #14#15
│        @ ~/.julia/packages/Oxygen/LWjgB/src/handlers.jl:54 [inlined]
│     [12] #14
│        @ ~/.julia/packages/Oxygen/LWjgB/src/handlers.jl:53 [inlined]
│     [13] (::Oxygen.Core.var"#56#58"{typeof(SimulationService.modelEquation), @NamedTuple{info::@NamedTuple{name::Symbol, args::Vector{Oxygen.Core.Types.Param}, kwargs::Vector{Oxygen.Core.Types.Param}, sig::Vector{Oxygen.Core.Types.Param}, sig_map::Dict{Symbol, Oxygen.Core.Types.Param}}, pathparams::Vector{Symbol}, queryparams::Vector{Symbol}}, Oxygen.Core.Handlers.var"#14#16"{Oxygen.Core.Handlers.var"#14#15#17"{Oxygen.Core.Handlers.var"#5#11"}}})(req::HTTP.Messages.Request)
│        @ Oxygen.Core ~/.julia/packages/Oxygen/LWjgB/src/core.jl:577
│     [14] (::HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing})(req::HTTP.Messages.Request)
│        @ HTTP.Handlers ~/.julia/packages/HTTP/sJD5V/src/Handlers.jl:439
│     [15] (::Oxygen.Core.var"#35#38"{HTTP.Messages.Request, HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}})()
│        @ Oxygen.Core ~/.julia/packages/Oxygen/LWjgB/src/core.jl:347
│     [16] handlerequest(getresponse::Oxygen.Core.var"#35#38"{HTTP.Messages.Request, HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}}, catch_errors::Bool; show_errors::Bool)
│        @ Oxygen.Core.Util ~/.julia/packages/Oxygen/LWjgB/src/utilities/misc.jl:37
│     [17] handlerequest
│        @ ~/.julia/packages/Oxygen/LWjgB/src/utilities/misc.jl:32 [inlined]
│     [18] #34
│        @ ~/.julia/packages/Oxygen/LWjgB/src/core.jl:346 [inlined]
│     [19] #41
│        @ ~/.julia/packages/Oxygen/LWjgB/src/core.jl:361 [inlined]
│     [20] handlerequest(getresponse::Oxygen.Core.var"#41#45"{HTTP.Messages.Request, Oxygen.Core.var"#34#37"{HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, Bool, Bool}, Oxygen.Core.AppContext.Service}, catch_errors::Bool; show_errors::Bool)
│        @ Oxygen.Core.Util ~/.julia/packages/Oxygen/LWjgB/src/utilities/misc.jl:37
│     [21] handlerequest
│        @ ~/.julia/packages/Oxygen/LWjgB/src/utilities/misc.jl:32 [inlined]
│     [22] #40
│        @ ~/.julia/packages/Oxygen/LWjgB/src/core.jl:358 [inlined]
│     [23] (::Oxygen.Core.var"#29#31"{Oxygen.Core.var"#40#44"{Oxygen.Core.var"#34#37"{HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, Bool, Bool}, Oxygen.Core.AppContext.Service, Bool}, HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, String})(req::HTTP.Messages.Request)
│        @ Oxygen.Core ~/.julia/packages/Oxygen/LWjgB/src/core.jl:331
│     [24] #12
│        @ ~/.julia/packages/Oxygen/LWjgB/src/core.jl:191 [inlined]
│     [25] (::HTTP.Handlers.var"#1#2"{Oxygen.Core.var"#12#14"{Oxygen.Core.var"#29#31"{Oxygen.Core.var"#40#44"{Oxygen.Core.var"#34#37"{HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, Bool, Bool}, Oxygen.Core.AppContext.Service, Bool}, HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, String}, Sockets.IPv4, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}}}})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}})
│        @ HTTP.Handlers ~/.julia/packages/HTTP/sJD5V/src/Handlers.jl:58
│     [26] #15
│        @ ~/.julia/packages/Oxygen/LWjgB/src/core.jl:208 [inlined]
│     [27] (::Oxygen.Core.var"#19#22"{HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.Connections.Connection{Sockets.TCPSocket}}, Oxygen.Core.var"#15#16"{Oxygen.Core.var"#29#31"{Oxygen.Core.var"#40#44"{Oxygen.Core.var"#34#37"{HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, Bool, Bool}, Oxygen.Core.AppContext.Service, Bool}, HTTP.Handlers.Router{typeof(HTTP.Handlers.default404), typeof(HTTP.Handlers.default405), Nothing}, String}}})()
│        @ Oxygen.Core ~/.julia/packages/Oxygen/LWjgB/src/core.jl:222
└ @ Oxygen.Core.Util ~/.julia/packages/Oxygen/LWjgB/src/utilities/misc.jl:40
bigglesandginger commented 1 month ago

Darn, this is an error with the SIR.json not SIR.pdf ... opps

mwdchang commented 1 month ago

This doesn't seem like an issue with sciml-service, we sent a model with a badly formatted mathml-expression <apply><plus/><ci>I</ci><ci>R</ci>, so the problem is whoever is generating or updating this particular field

            "observables": [
                {
                    "id": "Diagnosed",
                    "name": "Diagnosed",
                    "expression": "I + R",
                    "expression_mathml": "<apply><plus/><ci>I</ci><ci>R</ci>"
                }
            ],