Skip to content

Commit 39492ba

Browse files
committed
Fix CI failure
1 parent 82f91e4 commit 39492ba

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,9 @@ function process_DEProblem(constructor, sys::AbstractODESystem,u0map,parammap;
291291
u0 = varmap_to_vars(u0map,dvs; defaults=defs)
292292
p = varmap_to_vars(parammap,ps; defaults=defs)
293293

294-
length(dvs) == length(u0) || throw(ArgumentError("States ($(length(dvs))) and initial conditions ($(length(u0))) are of different lengths."))
294+
if u0 !== nothing
295+
length(dvs) == length(u0) || throw(ArgumentError("States ($(length(dvs))) and initial conditions ($(length(u0))) are of different lengths."))
296+
end
295297

296298
f = constructor(sys,dvs,ps,u0;tgrad=tgrad,jac=jac,checkbounds=checkbounds,
297299
linenumbers=linenumbers,parallel=parallel,simplify=simplify,

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ function process_NonlinearProblem(constructor, sys::NonlinearSystem,u0map,paramm
211211
u0 = varmap_to_vars(u0map,dvs; defaults=defs)
212212
p = varmap_to_vars(parammap,ps; defaults=defs)
213213

214-
length(dvs) == length(u0) || throw(ArgumentError("States ($(length(dvs))) and initial conditions ($(length(u0))) are of different lengths."))
214+
if u0 !== nothing
215+
length(dvs) == length(u0) || throw(ArgumentError("States ($(length(dvs))) and initial conditions ($(length(u0))) are of different lengths."))
216+
end
215217

216218
f = constructor(sys,dvs,ps,u0;jac=jac,checkbounds=checkbounds,
217219
linenumbers=linenumbers,parallel=parallel,simplify=simplify,

0 commit comments

Comments
 (0)