Skip to content

Commit

Permalink
fix: fix remake for IntervalNonlinearProblem
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jun 28, 2024
1 parent c2fb81f commit ea1e723
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/remake.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ function remake(prob::AbstractSciMLProblem; u0 = missing,
_remake_internal(prob; kwargs..., u0, p)
end

function remake(prob::AbstractIntervalNonlinearProblem; p = missing, interpret_symbolicmap = true, use_defaults = false, kwargs...)
_, p = updated_u0_p(prob, [], p; interpret_symbolicmap, use_defaults)
_remake_internal(prob; kwargs..., p)
end

function remake(prob::AbstractNoiseProblem; kwargs...)
_remake_internal(prob; kwargs...)
end
Expand Down
8 changes: 8 additions & 0 deletions test/remake_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,11 @@ u0 = [1.0; 2.0; 3.0]
tspan = (0.0, 100.0)
prob = ODEProblem(lorenz!, u0, tspan, nothing)
@test_nowarn remake(prob, p = (), interpret_symbolicmap = true)

# IntervalNonlinearProblem doesn't have a u0
# Issue#726
interval_f(u, p) = u * u - 2.0 + p[1]
uspan = (1.0, 2.0)
prob_int = IntervalNonlinearProblem(interval_f, uspan)
prob2 = @inferred IntervalNonlinearProblem remake(prob_int; p = [0])
@test prob2.p == [2]

0 comments on commit ea1e723

Please sign in to comment.