Skip to content

Commit baa04ab

Browse files
fix: remove implicit dependency on MTK
1 parent 1089e00 commit baa04ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/remake.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,10 @@ function remake(prob::OptimizationProblem;
273273
u0 = prob.u0
274274
end
275275
if (eltype(p) <: Pair && !isempty(p)) || (eltype(u0) <: Pair && !isempty(u0)) # one is a non-empty symbolic map
276-
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :ps) ||
276+
isempty(parameter_symbols(prob)) &&
277277
throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
278278
" Please use `remake` with the `p` keyword argument as a vector of values, paying attention to parameter order."))
279-
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :states) ||
279+
isempty(variable_symbols(prob)) &&
280280
throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
281281
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order."))
282282
p, u0 = process_p_u0_symbolic(prob, p, u0)
@@ -342,10 +342,10 @@ function remake(prob::NonlinearProblem;
342342
u0 = prob.u0
343343
end
344344
if (eltype(p) <: Pair && !isempty(p)) || (eltype(u0) <: Pair && !isempty(u0)) # one is a non-empty symbolic map
345-
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :ps) ||
345+
isempty(parameter_symbols(prob)) &&
346346
throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
347347
" Please use `remake` with the `p` keyword argument as a vector of values, paying attention to parameter order."))
348-
hasproperty(prob.f, :sys) && hasfield(typeof(prob.f.sys), :states) ||
348+
isempty(variable_symbols(prob)) &&
349349
throw(ArgumentError("This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
350350
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order."))
351351
p, u0 = process_p_u0_symbolic(prob, p, u0)

0 commit comments

Comments
 (0)