Skip to content

Commit 3ea956c

Browse files
fix: retain initialization_data in DiscreteProblem
1 parent 6bd9ad4 commit 3ea956c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/systems/jumps/jumpsystem.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,15 @@ function DiffEqBase.DiscreteProblem(sys::JumpSystem, u0map, tspan::Union{Tuple,
425425
error("The passed in JumpSystem contains `Equation`s or continuous events, please use a problem type that supports these features, such as ODEProblem.")
426426
end
427427

428-
_, u0, p = process_SciMLProblem(EmptySciMLFunction, sys, u0map, parammap;
428+
_f, u0, p = process_SciMLProblem(EmptySciMLFunction, sys, u0map, parammap;
429429
t = tspan === nothing ? nothing : tspan[1], use_union, tofloat = false, check_length = false)
430430
f = DiffEqBase.DISCRETE_INPLACE_DEFAULT
431431

432432
observedfun = ObservedFunctionCache(
433433
sys; eval_expression, eval_module, checkbounds = get(kwargs, :checkbounds, false))
434434

435-
df = DiscreteFunction{true, true}(f; sys = sys, observed = observedfun)
435+
df = DiscreteFunction{true, true}(f; sys = sys, observed = observedfun,
436+
initialization_data = get(_f.kwargs, :initialization_data, nothing))
436437
DiscreteProblem(df, u0, tspan, p; kwargs...)
437438
end
438439

0 commit comments

Comments
 (0)