From 7e69b13c6b964e16a8f255b72dd083d79068aff7 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 3 Dec 2024 16:02:30 +0530 Subject: [PATCH] fix: support non-markovian index providers in `updated_u0_p` --- src/remake.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/remake.jl b/src/remake.jl index 61bb6991e..9cb47fb14 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -901,7 +901,7 @@ function _updated_u0_p_symmap(prob, u0, ::Val{true}, p, ::Val{false}, t0) # FIXME: need to provide `u` since the observed function expects it. # This is sort of an implicit dependency on MTK. The values of `u` won't actually be # used, since any state symbols in the expression were substituted out earlier. - temp_state = ProblemState(; u = state_values(prob), p = p, t = t0) + temp_state = ProblemState(; u = state_values(prob), p = p, t = t0, h = is_markovian(prob) ? nothing : get_history_function(prob)) for (k, v) in u0 u0[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state) end @@ -925,7 +925,7 @@ function _updated_u0_p_symmap(prob, u0, ::Val{false}, p, ::Val{true}, t0) # FIXME: need to provide `p` since the observed function expects an `MTKParameters` # this is sort of an implicit dependency on MTK. The values of `p` won't actually be # used, since any parameter symbols in the expression were substituted out earlier. - temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0) + temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0, h = is_markovian(prob) ? nothing : get_history_function(prob)) for (k, v) in p p[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state) end