@@ -273,10 +273,10 @@ function remake(prob::OptimizationProblem;
273
273
u0 = prob. u0
274
274
end
275
275
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)) &&
277
277
throw (ArgumentError (" This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
278
278
" 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)) &&
280
280
throw (ArgumentError (" This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
281
281
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order." ))
282
282
p, u0 = process_p_u0_symbolic (prob, p, u0)
@@ -342,10 +342,10 @@ function remake(prob::NonlinearProblem;
342
342
u0 = prob. u0
343
343
end
344
344
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)) &&
346
346
throw (ArgumentError (" This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
347
347
" 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)) &&
349
349
throw (ArgumentError (" This problem does not support symbolic maps with `remake`, i.e. it does not have a symbolic origin." *
350
350
" Please use `remake` with the `u0` keyword argument as a vector of values, paying attention to state order." ))
351
351
p, u0 = process_p_u0_symbolic (prob, p, u0)
0 commit comments