@@ -301,18 +301,22 @@ end
301301
302302function __initial_guess (f:: F , p:: P , t:: T ; fit_parameters = false ) where {F, P, T}
303303 if hasmethod (f, Tuple{P, T})
304- p isa SciMLBase. NullParameters &&
305- throw (ArgumentError (" `fit_parameters` is true but `prob.p` is not set." ))
306- fit_parameters && return vcat (f (p, t), p)
304+ if fit_parameters
305+ p isa SciMLBase. NullParameters &&
306+ throw (ArgumentError (" `fit_parameters` is true but `prob.p` is not set." ))
307+ return vcat (f (p, t), p)
308+ end
307309 return f (p, t)
308310 elseif hasmethod (f, Tuple{T})
309311 Base. depwarn (" initial guess function must take 2 inputs `(p, t)` instead of just \
310312 `t`. The single argument version has been deprecated and will be \
311313 removed in the next major release of SciMLBase." ,
312314 :__initial_guess )
313- p isa SciMLBase. NullParameters &&
314- throw (ArgumentError (" `fit_parameters` is true but `prob.p` is not set." ))
315- fit_parameters && return vcat (f (t), p)
315+ if fit_parameters
316+ p isa SciMLBase. NullParameters &&
317+ throw (ArgumentError (" `fit_parameters` is true but `prob.p` is not set." ))
318+ return vcat (f (t), p)
319+ end
316320 return f (t)
317321 else
318322 throw (ArgumentError (" `initial_guess` must be a function of the form `f(p, t)`" ))
0 commit comments