Skip to content

Commit 2b67034

Browse files
committed
Issue warning instead of error when independent variable is not a parameter
1 parent a595821 commit 2b67034

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const CheckUnits = 1 << 2
116116
function check_independent_variables(ivs)
117117
for iv in ivs
118118
isparameter(iv) ||
119-
throw(ArgumentError("Independent variable $iv is not a parameter."))
119+
@warn "Independent variable $iv should be defined with @independent_variables $iv."
120120
end
121121
end
122122

test/odesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ end
12021202
@test_nowarn @named sys = ODESystem([y ~ 0], x)
12031203

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

12071207
@parameters T
12081208
D = Differential(T)

0 commit comments

Comments
 (0)