I’ve been using Catalyst successfully for the past few weeks. It’s pretty great! However, I recently tried to update PlutoUI from 0.7.14 to 0.7.51 (not sure why such an old version was installed). I then updated all my packages which I believe installed a new version of ModelingToolkit (9.65.0 to 9.68.0). This seems to have broken the creation of any JumpProblem with a discrete event. This example, which I’ve recreated successfully several times before, throws the following error:
ERROR: type Nothing has no field head
Stacktrace:
[1] getproperty(x::Nothing, f::Symbol)
@ Base ./Base.jl:37
[2] _reset_aggregator!(expr::Nothing, integrator::Symbol)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/jumps/jumpsystem.jl:14
[3] _reset_aggregator!(expr::Expr, integrator::Symbol) (repeats 8 times)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/jumps/jumpsystem.jl:21
[4] _reset_aggregator!(expr::Expr, integrator::Symbol)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/jumps/jumpsystem.jl:15
[5] compile_affect(eqs::Vector{…}, cb::ModelingToolkit.SymbolicDiscreteCallback, sys::JumpSystem{…}, dvs::Vector{…}, ps::Vector{…}; outputidxs::Nothing, expression::Type, checkvars::Bool, eval_expression::Bool, eval_module::Module, postprocess_affect_expr!::typeof(ModelingToolkit._reset_aggregator!), kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:705
[6] generate_timed_callback(cb::ModelingToolkit.SymbolicDiscreteCallback, sys::JumpSystem{…}, dvs::Vector{…}, ps::Vector{…}; postprocess_affect_expr!::Function, kwargs::@Kwargs{…})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:1031
[7] generate_discrete_callback(cb::ModelingToolkit.SymbolicDiscreteCallback, sys::JumpSystem{…}, dvs::Vector{…}, ps::Vector{…}; postprocess_affect_expr!::Function, kwargs::@Kwargs{…})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:0
[8] generate_discrete_callback
@ ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:1071 [inlined]
[9] #690
@ ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:1116 [inlined]
[10] iterate
@ ./generator.jl:47 [inlined]
[11] _collect(c::Vector{…}, itr::Base.Generator{…}, ::Base.EltypeUnknown, isz::Base.HasShape{…})
@ Base ./array.jl:854
[12] collect_similar(cont::Vector{ModelingToolkit.SymbolicDiscreteCallback}, itr::Base.Generator{Vector{…}, ModelingToolkit.var"#690#691"{…}})
@ Base ./array.jl:763
[13] map(f::Function, A::Vector{ModelingToolkit.SymbolicDiscreteCallback})
@ Base ./abstractarray.jl:3285
[14] generate_discrete_callbacks(sys::JumpSystem{…}, dvs::Vector{…}, ps::Vector{…}; kwargs::@Kwargs{…})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:1115
[15] process_events(sys::JumpSystem{…}; callback::Nothing, kwargs::@Kwargs{…})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:1134
[16] process_events
@ ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/callbacks.jl:1127 [inlined]
[17] JumpProblem(js::JumpSystem{…}, prob::DiscreteProblem{…}, aggregator::JumpProcesses.NullAggregator; callback::Nothing, eval_expression::Bool, eval_module::Module, kwargs::@Kwargs{})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/jumps/jumpsystem.jl:582
[18] JumpProblem
@ ~/.julia/packages/ModelingToolkit/ZOG3I/src/systems/jumps/jumpsystem.jl:539 [inlined]
[19] #JumpProblem#185
@ ~/.julia/packages/Catalyst/48wH3/src/reactionsystem_conversions.jl:872 [inlined]
[20] JumpProblem
@ ~/.julia/packages/Catalyst/48wH3/src/reactionsystem_conversions.jl:869 [inlined]
[21] JumpProblem(jinputs::JumpInputs{JumpSystem{…}, DiscreteProblem{…}})
@ Catalyst ~/.julia/packages/Catalyst/48wH3/src/reactionsystem_conversions.jl:869
[22] top-level scope
@ REPL[21]:1
Some type information was truncated. Use `show(err)` to see complete types.
I tried downgrading ModelingToolkit back to 9.65.0 and uninstalled PlutoUI (can’t imagine that’s the problem but did it anyway) but it still does not fix the issue. I can’t figure out how I broke this!
Running Julia 1.10.5. Current package versions:
[824d6782] Bonito v4.0.3
[479239e8] Catalyst v14.4.1
[31a5f54b] Debugger v0.7.10
[0c46a032] DifferentialEquations v7.16.0
[96684042] InformationMeasures v0.3.1
[ccbc3e58] JumpProcesses v9.14.2
[23fbe1c1] Latexify v0.16.6
⌃ [961ee093] ModelingToolkit v9.65.0
[1dea7af3] OrdinaryDiffEq v6.92.0
[c3e4b0f8] Pluto v0.20.5
[295af30f] Revise v3.7.2
[2913bbd2] StatsBase v0.34.4
[789caeaf] StochasticDiffEq v6.74.1
[276b4fcb] WGLMakie v0.11.2
I tried a fresh install of Catalyst in a new environment and still run into this issue.