From a6fa5b480f37fe70c3224823314a290460005500 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 6 Dec 2024 17:06:48 +0530 Subject: [PATCH] fixup! feat: add proper `remake` for `DDEProblem` --- src/remake.jl | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/remake.jl b/src/remake.jl index 02cc33cb8..04a93edda 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -492,23 +492,20 @@ function remake(func::DDEFunction; analytic = missing, sys = missing, kwargs...) + props = getproperties(func) + props = @delete props.f + @reset props.mass_matrix = coalesce(mass_matrix, func.mass_matrix) + @reset props.analytic = coalesce(analytic, func.analytic) + @reset props.sys = coalesce(sys, func.sys) + if f === missing f = func.f end - - if mass_matrix === missing - mass_matrix = func.mass_matrix - end - - if analytic === missing - analytic = func.analytic - end - - if sys === missing - sys = func.sys + if f isa AbstractSciMLFunction + f = f.f end - return DDEFunction(f; mass_matrix, analytic, sys, kwargs...) + return DDEFunction(f; props..., kwargs...) end function remake(prob::SDDEProblem;