Skip to content

Commit a74be37

Browse files
Merge pull request #888 from AayushSabharwal/as/fix-remake
fix: check if `prob.f.sys` exists before accessing it in `remake`
2 parents 3cf7743 + 9d0e938 commit a74be37

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/remake.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ function updated_u0_p(
804804
if u0 === missing && p === missing
805805
return state_values(prob), parameter_values(prob)
806806
end
807-
if prob.f.sys === nothing
807+
if has_sys(prob.f) && prob.f.sys === nothing
808808
if interpret_symbolicmap && eltype(p) !== Union{} && eltype(p) <: Pair
809809
throw(ArgumentError("This problem does not support symbolic maps with " *
810810
"`remake`, i.e. it does not have a symbolic origin. Please use `remake`" *

test/downstream/problem_interface.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ eprob = EnsembleProblem(oprob)
261261
@test eprob.ps[osys.p] == 0.1
262262

263263
@test state_values(remake(eprob; u0 = [X => 0.1])) == [0.1]
264-
@test_broken state_values(remake(eprob; u0 = [:X => 0.2])) == [0.2]
264+
@test state_values(remake(eprob; u0 = [:X => 0.2])) == [0.2]
265265
@test state_values(remake(eprob; u0 = [osys.X => 0.3])) == [0.3]
266266

267-
@test_broken remake(eprob; p = [d => 0.4]).ps[d] == 0.4
268-
@test_broken remake(eprob; p = [:d => 0.5]).ps[d] == 0.5
269-
@test_broken remake(eprob; p = [osys.d => 0.6]).ps[d] == 0.6
267+
@test remake(eprob; p = [d => 0.4]).ps[d] == 0.4
268+
@test remake(eprob; p = [:d => 0.5]).ps[d] == 0.5
269+
@test remake(eprob; p = [osys.d => 0.6]).ps[d] == 0.6
270270

271271
# SteadyStateProblem Indexing
272272
# Issue#660

0 commit comments

Comments
 (0)