We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The code below works in version 5.6 but not in 5.7 (and more recent versions).
using ModelingToolkit, SciMLBase, Serialization @parameters t @variables x(t) D = Differential(t) sys = ODESystem([D(x) ~ -0.5*x]) prob = eval(ModelingToolkit.ODEProblemExpr{false}(sys, nothing, nothing, SciMLBase.NullParameters())) _fn = tempname() open(_fn, "w") do f serialize(f, prob) end _cmd = "using ModelingToolkit, Serialization; deserialize(\"$_fn\")" run(`$(Base.julia_cmd()) -e $(_cmd)`)
The failure is
ERROR: UndefVarError: ###f#261 not defined Stacktrace: [1] deserialize_datatype(s::Serializer{IOStream}, full::Bool) @ Serialization ~/julia/usr/share/julia/stdlib/v1.6/Serialization/src/Serialization.jl:1278 ...
which is the type of the ODE closure
julia> typeof(prob.f.f) var"###f#261"
Notice that if I construct the problem via the ODEProblem constructor then I don't get the error and the closure type is different
ODEProblem
julia> typeof(prob.f.f) ModelingToolkit.var"#f#251"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#273"), Symbol("##arg#274"), :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xcfab6c31, 0x4234d024, 0xc8d24f26, 0x00e8741b, 0xdef727f3)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#275"), Symbol("##arg#273"), Symbol("##arg#274"), :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x1649a627, 0x3083de65, 0x3aff2680, 0x103a1319, 0xebfbfbe8)}}
The text was updated successfully, but these errors were encountered:
This looks like it's likely an upstream issue with build_function due to #764 (upstream as this is now in Symbolics.jl)
build_function
Sorry, something went wrong.
Merge pull request #857 from mohamed82008/mt/fix_841
b8d31f8
Fix #841
Successfully merging a pull request may close this issue.
The code below works in version 5.6 but not in 5.7 (and more recent versions).
The failure is
which is the type of the ODE closure
Notice that if I construct the problem via the
ODEProblem
constructor then I don't get the error and the closure type is differentThe text was updated successfully, but these errors were encountered: