Skip to content

Commit

Permalink
fix: NonlinearLeastSquaresProblem is not a trivial initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 29, 2024
1 parent f09aee5 commit 176ab02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/initialization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function get_initial_values(prob, valp, f, alg::OverrideInit,
initdata.update_initializeprob!(initprob, valp)
end

if state_values(initprob) === nothing
if is_trivial_initialization(initdata)
nlsol = initprob
success = true
else
Expand Down Expand Up @@ -227,7 +227,7 @@ function get_initial_values(prob, valp, f, alg::OverrideInit,
end

function is_trivial_initialization(initdata::OverrideInitData)
state_values(initdata.initializeprob) === nothing
!(initdata.initializeprob isa NonlinearLeastSquaresProblem) && state_values(initdata.initializeprob) === nothing
end

function is_trivial_initialization(f::AbstractSciMLFunction)
Expand Down

0 comments on commit 176ab02

Please sign in to comment.