Skip to content

Commit 028ba89

Browse files
committed
format
1 parent cb046ff commit 028ba89

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/systems/model_parsing.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ function _model_macro(mod, fullname::Union{Expr, Symbol}, expr, isconnector)
119119
push!(exprs.args, :(push!(systems, $(comps...))))
120120
push!(exprs.args, :(push!(variables, $(vs...))))
121121

122-
123122
gui_metadata = isassigned(icon) > 0 ? GUIMetadata(GlobalRef(mod, name), icon[]) :
124123
GUIMetadata(GlobalRef(mod, name))
125124

@@ -1161,18 +1160,18 @@ function parse_discrete_events!(d_evts, dict, body)
11611160
end
11621161
end
11631162

1164-
function parse_constraints!(cons, dict, body)
1165-
dict[:constraints] = []
1163+
function parse_constraints!(cons, dict, body)
1164+
dict[:constraints] = []
11661165
Base.remove_linenums!(body)
11671166
for arg in body.args
11681167
push!(cons, arg)
11691168
push!(dict[:constraints], readable_code.(cons)...)
11701169
end
11711170
end
11721171

1173-
function parse_costs!(costs, dict, body)
1172+
function parse_costs!(costs, dict, body)
11741173
@show dict
1175-
dict[:costs] = []
1174+
dict[:costs] = []
11761175
Base.remove_linenums!(body)
11771176
for arg in body.args
11781177
push!(costs, arg)

src/variables.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ getshift(x::Symbolic) = Symbolics.getmetadata(x, VariableShift, 0)
616616
###################
617617
### Evaluate at ###
618618
###################
619-
struct At <: Symbolics.Operator
619+
struct At <: Symbolics.Operator
620620
t::Union{Symbolic, Number}
621621
end
622622

@@ -636,7 +636,8 @@ function (A::At)(x::Symbolic)
636636
x = default_toterm(x)
637637
A(x)
638638
else
639-
length(arguments(x)) !== 1 && error("Variable $x has too many arguments. At can only be applied to one-argument variables.")
639+
length(arguments(x)) !== 1 &&
640+
error("Variable $x has too many arguments. At can only be applied to one-argument variables.")
640641
(symbolic_type(only(arguments(x))) !== ScalarSymbolic()) && return x
641642
return operation(x)(A.t)
642643
end

test/model_parsing.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ end
10501050
@named ex = Example()
10511051
ex = complete(ex)
10521052

1053-
costs = ModelingToolkit.get_costs(ex)
1053+
costs = ModelingToolkit.get_costs(ex)
10541054
constrs = ModelingToolkit.get_constraints(ModelingToolkit.get_constraintsystem(ex))
10551055
@test isequal(costs[1], ex.x + ex.y)
10561056
@test isequal(costs[2], At(1)(ex.y)^2)

test/variable_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ end
173173

174174
arr = At(1)(w)
175175
var = At(1)(w[1])
176-
@test arr isa Symbolics.Arr
176+
@test arr isa Symbolics.Arr
177177
@test var isa Num
178-
178+
179179
@test isequal(At(1)(r), r)
180180
@test isequal(At(1)(r[2]), r[2])
181181

0 commit comments

Comments
 (0)