From 146324212af1b4eed891038dc2d2ec3d0df1fcb8 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 15:22:45 -0400 Subject: [PATCH 1/2] Skip special remakes on non-ODEFunction These all assume ODEFunction @AayushSabharwal --- src/remake.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/remake.jl b/src/remake.jl index 6c8fb80e1..11aa0c390 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -102,7 +102,9 @@ function remake(prob::ODEProblem; f = missing, iip = isinplace(prob) - if f === missing + if f isa AbstractODEFunction && !(f isa ODEFunction) + _f = f + elseif f === missing initializeprob, initializeprobmap = remake_initializeprob( prob.f.sys, prob.f, u0 === missing ? newu0 : u0, tspan[1], p === missing ? newp : p) @@ -128,8 +130,6 @@ function remake(prob::ODEProblem; f = missing, @reset _f.initializeprob = initializeprob @reset _f.initializeprobmap = initializeprobmap end - elseif f isa AbstractODEFunction - _f = f elseif specialization(prob.f) === FunctionWrapperSpecialize ptspan = promote_tspan(tspan) if iip From 58b24d208977c709f88187de580f48dcc0b9d2a7 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 17:05:50 -0400 Subject: [PATCH 2/2] Update src/remake.jl --- src/remake.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remake.jl b/src/remake.jl index 11aa0c390..754df6bda 100644 --- a/src/remake.jl +++ b/src/remake.jl @@ -104,7 +104,7 @@ function remake(prob::ODEProblem; f = missing, if f isa AbstractODEFunction && !(f isa ODEFunction) _f = f - elseif f === missing + elseif f === missing && prob.f isa ODEFunction initializeprob, initializeprobmap = remake_initializeprob( prob.f.sys, prob.f, u0 === missing ? newu0 : u0, tspan[1], p === missing ? newp : p)