Skip to content

Commit

Permalink
Show all unknowns missing guesses; not only the first
Browse files Browse the repository at this point in the history
  • Loading branch information
hersle committed Jul 18, 2024
1 parent 6f1cffb commit 536aff6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/systems/diffeqs/abstractodesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1567,11 +1567,9 @@ function InitializationProblem{iip, specialize}(sys::AbstractODESystem,
defs = defaults(isys)

# Check that all unknowns have guesses
# TODO: which, if any, unknowns should be excluded from this guess?
for x in unknowns(isys)
x in keys(guesses) || x in keys(defs) ||
throw(ArgumentError("Missing guess for $x."))
end
unknowns_missing = setdiff(unknowns(isys), [keys(guesses), keys(defs)])
!isempty(unknowns_missing) &&
throw(ArgumentError("Missing guesses for unknowns $(join(unknowns_missing, ", "))."))

u0map = merge(guesses, u0map)
if neqs == nunknown
Expand Down

0 comments on commit 536aff6

Please sign in to comment.