Skip to content

Commit 4b09efc

Browse files
fix: support non-markovian index providers in updated_u0_p
1 parent 1dcbc83 commit 4b09efc

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
@@ -924,7 +924,8 @@ function _updated_u0_p_symmap(prob, u0, ::Val{true}, p, ::Val{false}, t0)
924924
# FIXME: need to provide `u` since the observed function expects it.
925925
# This is sort of an implicit dependency on MTK. The values of `u` won't actually be
926926
# used, since any state symbols in the expression were substituted out earlier.
927-
temp_state = ProblemState(; u = state_values(prob), p = p, t = t0)
927+
temp_state = ProblemState(; u = state_values(prob), p = p, t = t0,
928+
h = is_markovian(prob) ? nothing : get_history_function(prob))
928929
for (k, v) in u0
929930
u0[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state)
930931
end
@@ -948,7 +949,8 @@ function _updated_u0_p_symmap(prob, u0, ::Val{false}, p, ::Val{true}, t0)
948949
# FIXME: need to provide `p` since the observed function expects an `MTKParameters`
949950
# this is sort of an implicit dependency on MTK. The values of `p` won't actually be
950951
# used, since any parameter symbols in the expression were substituted out earlier.
951-
temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0)
952+
temp_state = ProblemState(; u = u0, p = parameter_values(prob), t = t0,
953+
h = is_markovian(prob) ? nothing : get_history_function(prob))
952954
for (k, v) in p
953955
p[k] = symbolic_type(v) === NotSymbolic() ? v : getsym(prob, v)(temp_state)
954956
end

0 commit comments

Comments
 (0)