Skip to content

Commit 2188104

Browse files
fix: allow specifying f for remake of SCCNonlinearProblem
1 parent 8b8d8f2 commit 2188104

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/remake.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ error and require that `probs` be specified. `probs` is the collection of subpro
792792
override the values in `probs`. `sys` is the index provider for the full system.
793793
"""
794794
function remake(prob::SCCNonlinearProblem; u0 = missing, p = missing, probs = missing,
795-
parameters_alias = prob.parameters_alias, sys = missing,
795+
parameters_alias = prob.parameters_alias, f = missing, sys = missing,
796796
interpret_symbolicmap = true, use_defaults = false, explicitfuns! = missing)
797797
if p !== missing && !parameters_alias && probs === missing
798798
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
816816
return subprob
817817
end
818818
end
819-
if sys === missing
820-
sys = prob.f.sys
821-
end
819+
f = coalesce(f, prob.f)
820+
f = remake(f; sys)
821+
props = getproperties(f)
822+
props = @delete props.f
823+
822824
return SCCNonlinearProblem(
823-
probs, explicitfuns!, newp, parameters_alias; sys)
825+
probs, explicitfuns!, newp, parameters_alias; props...)
824826
end
825827

826828
function varmap_has_var(varmap, var)

0 commit comments

Comments
 (0)