Skip to content

Commit 7e69b13

Browse files
fix: support non-markovian index providers in updated_u0_p
1 parent 5e48394 commit 7e69b13

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/remake.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ function _updated_u0_p_symmap(prob, u0, ::Val{true}, p, ::Val{false}, t0)
901901
# FIXME: need to provide `u` since the observed function expects it.
902902
# This is sort of an implicit dependency on MTK. The values of `u` won't actually be
903903
# used, since any state symbols in the expression were substituted out earlier.
904-
temp_state = ProblemState(; u = state_values(prob), p = p, t = t0)
904+
temp_state = ProblemState(; u = state_values(prob), p = p, t = t0, h = is_markovian(prob) ? nothing : get_history_function(prob))
905905
for (k, v) in u0
906906
u0[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state)
907907
end
@@ -925,7 +925,7 @@ function _updated_u0_p_symmap(prob, u0, ::Val{false}, p, ::Val{true}, t0)
925925
# FIXME: need to provide `p` since the observed function expects an `MTKParameters`
926926
# this is sort of an implicit dependency on MTK. The values of `p` won't actually be
927927
# used, since any parameter symbols in the expression were substituted out earlier.
928-
temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0)
928+
temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0, h = is_markovian(prob) ? nothing : get_history_function(prob))
929929
for (k, v) in p
930930
p[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state)
931931
end

0 commit comments

Comments
 (0)