Skip to content

Commit d2c7570

Browse files
fix: fix @reset changing specialization of ODEFunction
1 parent 9978e5b commit d2c7570

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/remake.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,20 @@ function remake(prob::ODEProblem; f = missing,
125125
end
126126
else
127127
_f = prob.f
128-
@reset _f.initializeprob = initializeprob
129-
@reset _f.initializeprobmap = initializeprobmap
128+
if __has_initializeprob(_f)
129+
props = getproperties(_f)
130+
@reset props.initializeprob = initializeprob
131+
props = values(props)
132+
_f = parameterless_type(_f){
133+
iip, specialization(_f), map(typeof, props)...}(props...)
134+
end
135+
if __has_initializeprobmap(_f)
136+
props = getproperties(_f)
137+
@reset props.initializeprobmap = initializeprobmap
138+
props = values(props)
139+
_f = parameterless_type(_f){
140+
iip, specialization(_f), map(typeof, props)...}(props...)
141+
end
130142
end
131143
elseif f isa AbstractODEFunction
132144
_f = f

0 commit comments

Comments
 (0)