Skip to content

Commit 2db6556

Browse files
refactor: remove old remake(::NonlinearFunction)
1 parent af02155 commit 2db6556

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

src/remake.jl

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ function remake(prob::NonlinearProblem;
702702
initialization_data = nothing
703703
end
704704

705+
f = coalesce(f, prob.f)
705706
f = remake(prob.f; f, initialization_data)
706707

707708
if problem_type === missing
@@ -733,22 +734,6 @@ function remake(prob::NonlinearProblem;
733734
return prob
734735
end
735736

736-
function remake(func::NonlinearFunction;
737-
f = missing,
738-
kwargs...)
739-
props = getproperties(func)
740-
props = @delete props.f
741-
742-
if f === missing
743-
f = func.f
744-
end
745-
if f isa AbstractSciMLFunction
746-
f = f.f
747-
end
748-
749-
return NonlinearFunction{isinplace(func)}(f; props..., kwargs...)
750-
end
751-
752737
"""
753738
remake(prob::NonlinearLeastSquaresProblem; f = missing, u0 = missing, p = missing,
754739
kwargs = missing, _kwargs...)
@@ -771,6 +756,7 @@ function remake(prob::NonlinearLeastSquaresProblem; f = missing, u0 = missing, p
771756
initialization_data = nothing
772757
end
773758

759+
f = coalesce(f, prob.f)
774760
f = remake(prob.f; f, initialization_data)
775761

776762
prob = if kwargs === missing

0 commit comments

Comments
 (0)