Skip to content

Commit 36adaed

Browse files
committed
Update src/systems/validation.jl
1 parent e29a09f commit 36adaed

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/systems/validation.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ MT = ModelingToolkit
2929
```
3030
"""
3131
equivalent(x, y) = isequal(1 * x, 1 * y)
32-
unitless = Unitful.unit(1)
32+
const unitless = Unitful.unit(1)
3333

3434
#For dispatching get_unit
35-
Literal = Union{Sym, Symbolics.ArrayOp, Symbolics.Arr, Symbolics.CallWithMetadata}
36-
Conditional = Union{typeof(ifelse), typeof(IfElse.ifelse)}
37-
Comparison = Union{typeof.([==, !=, , <, <=, , >, >=, ])...}
35+
const Literal = Union{Sym, Symbolics.ArrayOp, Symbolics.Arr, Symbolics.CallWithMetadata}
36+
const Conditional = Union{typeof(ifelse), typeof(IfElse.ifelse)}
37+
const Comparison = Union{typeof.([==, !=, , <, <=, , >, >=, ])...}
3838

3939
"Find the unit of a symbolic item."
4040
get_unit(x::Real) = unitless
@@ -175,7 +175,8 @@ function _validate(conn::Connection; info::String = "")
175175
syss = get_systems(conn)
176176
sys = first(syss)
177177
st = states(sys)
178-
for s in syss[2:end]
178+
for i in 2:length(syss)
179+
s = syss[i]
179180
sst = states(s)
180181
if length(st) != length(sst)
181182
valid = false

0 commit comments

Comments
 (0)