Skip to content

Commit dea3372

Browse files
fix: support non-markovian index providers in updated_u0_p
1 parent fca7872 commit dea3372

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/remake.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,8 @@ function _updated_u0_p_symmap(prob, u0, ::Val{true}, p, ::Val{false}, t0)
906906
# FIXME: need to provide `u` since the observed function expects it.
907907
# This is sort of an implicit dependency on MTK. The values of `u` won't actually be
908908
# used, since any state symbols in the expression were substituted out earlier.
909-
temp_state = ProblemState(; u = state_values(prob), p = p, t = t0)
909+
temp_state = ProblemState(; u = state_values(prob), p = p, t = t0,
910+
h = is_markovian(prob) ? nothing : get_history_function(prob))
910911
for (k, v) in u0
911912
u0[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state)
912913
end
@@ -930,7 +931,8 @@ function _updated_u0_p_symmap(prob, u0, ::Val{false}, p, ::Val{true}, t0)
930931
# FIXME: need to provide `p` since the observed function expects an `MTKParameters`
931932
# this is sort of an implicit dependency on MTK. The values of `p` won't actually be
932933
# used, since any parameter symbols in the expression were substituted out earlier.
933-
temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0)
934+
temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0,
935+
h = is_markovian(prob) ? nothing : get_history_function(prob))
934936
for (k, v) in p
935937
p[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state)
936938
end

0 commit comments

Comments
 (0)