Skip to content

Commit

Permalink
fix remake_prob for additional params
Browse files Browse the repository at this point in the history
  • Loading branch information
ivborissov committed Jul 22, 2024
1 parent 73dfdc4 commit 3ff31f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ode_problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ function remake_prob(prob::ODEProblem, init_func::Function, params::NamedTuple;
p0 = ArrayPartition(_p0[1:length(_p0)-length(params)], collect(eltype(_p0), params))
prob0.u0 .= u0
# tmp to if additional params are provided
length(prob0.p) == length(p0) ? prob0.p .= p0 : remake(prob0; p=p0)
return prob0
if length(prob0.p) == length(p0)
prob0.p .= p0
return prob0
else
return remake(prob0; p=p0)
end
else
return prob0
end
Expand Down

0 comments on commit 3ff31f7

Please sign in to comment.