Skip to content

Commit 9ffe562

Browse files
committed
Allow incomplete initialization
1 parent 6669043 commit 9ffe562

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/variables.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ applicable.
1212
"""
1313
function varmap_to_vars(varmap, varlist; defaults=Dict(), check=true)
1414
# Edge cases where one of the arguments is effectively empty.
15-
if varmap isa DiffEqBase.NullParameters || varmap === nothing || isempty(varmap)
15+
is_incomplete_initialization = varmap isa DiffEqBase.NullParameters || varmap === nothing
16+
if is_incomplete_initialization || isempty(varmap)
1617
if isempty(defaults)
17-
check && (isempty(varlist) || throw_missingvars(varlist))
18+
if !is_incomplete_initialization && check
19+
isempty(varlist) || throw_missingvars(varlist)
20+
end
1821
return nothing
1922
else
2023
varmap = Dict()

test/sdesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ solexpr = solve(eval(probexpr),SRIW1(),seed=1)
2929
@test all(x->x==0,Array(sol-solexpr))
3030

3131
# Test no error
32-
@test_nowarn SDEProblem(de,zeros(3),(0, 10.0),zeros(3))
32+
@test_nowarn SDEProblem(de,nothing,(0, 10.0))
3333

3434
noiseeqs_nd = [0.01*x 0.01*x*y 0.02*x*z
3535
σ 0.01*y 0.02*x*z

0 commit comments

Comments
 (0)