Skip to content

Commit

Permalink
Issue warning instead of error when independent variable is not a par…
Browse files Browse the repository at this point in the history
…ameter
  • Loading branch information
hersle committed Jul 17, 2024
1 parent a595821 commit 2b67034
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const CheckUnits = 1 << 2
function check_independent_variables(ivs)
for iv in ivs
isparameter(iv) ||
throw(ArgumentError("Independent variable $iv is not a parameter."))
@warn "Independent variable $iv should be defined with @independent_variables $iv."
end
end

Expand Down
2 changes: 1 addition & 1 deletion test/odesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ end
@test_nowarn @named sys = ODESystem([y ~ 0], x)

@variables x y(x)
@test_throws ArgumentError @named sys = ODESystem([y ~ 0], x)
@test_logs (:warn,) @named sys = ODESystem([y ~ 0], x)

@parameters T
D = Differential(T)
Expand Down

0 comments on commit 2b67034

Please sign in to comment.