Skip to content

Commit

Permalink
refactor: remove check_length in the error message of unbalanced system
Browse files Browse the repository at this point in the history
  • Loading branch information
sathvikbhagavan committed May 2, 2024
1 parent cadd012 commit 5384e58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2219,13 +2219,13 @@ function check_eqs_u0(eqs, dvs, u0; check_length = true, kwargs...)
if u0 !== nothing
if check_length
if !(length(eqs) == length(dvs) == length(u0))
throw(ArgumentError("Equations ($(length(eqs))), unknowns ($(length(dvs))), and initial conditions ($(length(u0))) are of different lengths. To allow a different number of equations than unknowns use kwarg check_length=false."))
throw(ArgumentError("Equations ($(length(eqs))), unknowns ($(length(dvs))), and initial conditions ($(length(u0))) are of different lengths."))

Check warning on line 2222 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L2222

Added line #L2222 was not covered by tests
end
elseif length(dvs) != length(u0)
throw(ArgumentError("Unknowns ($(length(dvs))) and initial conditions ($(length(u0))) are of different lengths."))
end
elseif check_length && (length(eqs) != length(dvs))
throw(ArgumentError("Equations ($(length(eqs))) and Unknowns ($(length(dvs))) are of different lengths. To allow these to differ use kwarg check_length=false."))
throw(ArgumentError("Equations ($(length(eqs))) and Unknowns ($(length(dvs))) are of different lengths."))

Check warning on line 2228 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L2228

Added line #L2228 was not covered by tests
end
return nothing
end
Expand Down

0 comments on commit 5384e58

Please sign in to comment.