From 99baebd011a9d449b3be2ba58d66647a2bc88d53 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 6 Dec 2024 17:47:58 +0530 Subject: [PATCH] fix: allow specifying `f` for `remake` of `SCCNonlinearProblem` --- src/remake.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/remake.jl b/src/remake.jl index ae02dbb11..b331111da 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -792,7 +792,7 @@ error and require that `probs` be specified. `probs` is the collection of subpro override the values in `probs`. `sys` is the index provider for the full system. """ function remake(prob::SCCNonlinearProblem; u0 = missing, p = missing, probs = missing, - parameters_alias = prob.parameters_alias, sys = missing, + parameters_alias = prob.parameters_alias, f = missing, sys = missing, interpret_symbolicmap = true, use_defaults = false, explicitfuns! = missing) if p !== missing && !parameters_alias && probs === missing throw(ArgumentError("`parameters_alias` is `false` for the given `SCCNonlinearProblem`. Please provide the subproblems using the keyword `probs` with the parameters updated appropriately in each.")) @@ -816,11 +816,13 @@ function remake(prob::SCCNonlinearProblem; u0 = missing, p = missing, probs = mi return subprob end end - if sys === missing - sys = prob.f.sys - end + f = coalesce(f, prob.f) + f = remake(f; sys) + props = getproperties(f) + props = @delete props.f + return SCCNonlinearProblem( - probs, explicitfuns!, newp, parameters_alias; sys) + probs, explicitfuns!, newp, parameters_alias; props...) end function varmap_has_var(varmap, var)