From 176ab02b8b369344c8741ac44c1360c69cee7d5d Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 29 Nov 2024 11:44:26 +0530 Subject: [PATCH] fix: `NonlinearLeastSquaresProblem` is not a trivial initialization --- src/initialization.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/initialization.jl b/src/initialization.jl index eea553005..aa541e5c3 100644 --- a/src/initialization.jl +++ b/src/initialization.jl @@ -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 @@ -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)