Skip to content

Commit bf8170a

Browse files
author
SciML Bot
committed
Apply JuliaFormatter to fix code formatting
- Applied JuliaFormatter with SciML style guide - Formatted 50 files 🤖 Generated by OrgMaintenanceScripts.jl
1 parent 419208b commit bf8170a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+256
-233
lines changed

docs/src/API/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ For systems that contain parameters with metadata like described above, have som
293293
In the example below, we define a system with tunable parameters and extract bounds vectors
294294

295295
```@example metadata
296-
@variables x(t)=0 u(t)=0 [input = true] y(t)=0 [output = true]
296+
@variables x(t)=0 u(t)=0 [input=true] y(t)=0 [output=true]
297297
@parameters T [tunable = true, bounds = (0, Inf)]
298298
@parameters k [tunable = true, bounds = (0, Inf)]
299299
eqs = [D(x) ~ (-x + k * u) / T # A first-order system with time constant T and gain k

docs/src/basics/Events.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ so far we aren't using anything that's not possible with the implicit interface.
497497
You can also write
498498

499499
```julia
500-
[temp ~ furnace_off_threshold] => ModelingToolkit.ImperativeAffect(modified = (;
500+
[temp ~
501+
furnace_off_threshold] => ModelingToolkit.ImperativeAffect(modified = (;
501502
furnace_on)) do x, o, i, c
502503
@set! x.furnace_on = false
503504
end

docs/src/basics/MTKLanguage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ Refer the following example for different ways to define symbolic arrays.
382382
p1[1:4]
383383
p2[1:N]
384384
p3[1:N,
385-
1:M] = 10,
385+
1:M] = 10,
386386
[description = "A multi-dimensional array of arbitrary length with description"]
387387
(p4[1:N, 1:M] = 10),
388388
[description = "An alternate syntax for p3 to match the syntax of vanilla parameters macro"]

docs/src/basics/Validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function ModelingToolkit.get_unit(op::typeof(dummycomplex), args)
108108
end
109109
110110
sts = @variables a(t)=0 [unit = u"cm"]
111-
ps = @parameters s=-1 [unit = u"cm"] c=c [unit = u"cm"]
111+
ps = @parameters s=-1 [unit=u"cm"] c=c [unit=u"cm"]
112112
eqs = [D(a) ~ dummycomplex(c, s);]
113113
sys = System(
114114
eqs, t, [sts...;], [ps...;], name = :sys, checks = ~ModelingToolkit.CheckUnits)

docs/src/examples/sparse_jacobians.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ function brusselator_2d_loop(du, u, p, t)
2727
jm1 = limit(i + 1, N), limit(i - 1, N), limit(j + 1, N),
2828
limit(j - 1, N)
2929
du[i,
30-
j,
31-
1] = alpha * (u[im1, j, 1] + u[ip1, j, 1] + u[i, jp1, 1] + u[i, jm1, 1] -
32-
4u[i, j, 1]) +
33-
B + u[i, j, 1]^2 * u[i, j, 2] - (A + 1) * u[i, j, 1] +
34-
brusselator_f(x, y, t)
30+
j,
31+
1] = alpha * (u[im1, j, 1] + u[ip1, j, 1] + u[i, jp1, 1] + u[i, jm1, 1] -
32+
4u[i, j, 1]) +
33+
B + u[i, j, 1]^2 * u[i, j, 2] - (A + 1) * u[i, j, 1] +
34+
brusselator_f(x, y, t)
3535
du[i,
36-
j,
37-
2] = alpha * (u[im1, j, 2] + u[ip1, j, 2] + u[i, jp1, 2] + u[i, jm1, 2] -
38-
4u[i, j, 2]) +
39-
A * u[i, j, 1] - u[i, j, 1]^2 * u[i, j, 2]
36+
j,
37+
2] = alpha * (u[im1, j, 2] + u[ip1, j, 2] + u[i, jp1, 2] + u[i, jm1, 2] -
38+
4u[i, j, 2]) +
39+
A * u[i, j, 1] - u[i, j, 1]^2 * u[i, j, 2]
4040
end
4141
end
4242
p = (3.4, 1.0, 10.0, step(xyd_brusselator))

docs/src/examples/tearing_parallelism.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using ModelingToolkit: t_nounits as t, D_nounits as D
1515
1616
# Basic electric components
1717
@connector function Pin(; name)
18-
@variables v(t)=1.0 i(t)=1.0 [connect = Flow]
18+
@variables v(t)=1.0 i(t)=1.0 [connect=Flow]
1919
System(Equation[], t, [v, i], [], name = name)
2020
end
2121
@@ -36,7 +36,7 @@ function ConstantVoltage(; name, V = 1.0)
3636
end
3737
3838
@connector function HeatPort(; name)
39-
@variables T(t)=293.15 Q_flow(t)=0.0 [connect = Flow]
39+
@variables T(t)=293.15 Q_flow(t)=0.0 [connect=Flow]
4040
System(Equation[], t, [T, Q_flow], [], name = name)
4141
end
4242

src/bipartite_graph.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ function Graphs.incidence_matrix(g::BipartiteGraph, val = true)
635635
I = Int[]
636636
J = Int[]
637637
for i in 𝑠vertices(g), n in 𝑠neighbors(g, i)
638+
638639
push!(I, i)
639640
push!(J, n)
640641
end

src/deprecations.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ for T in [:ODEProblem, :DDEProblem, :SDEProblem, :SDDEProblem, :DAEProblem,
7272
end
7373

7474
for pType in [SciMLBase.NullParameters, Nothing], uType in [Any, Nothing]
75+
7576
@eval function SciMLBase.$T(sys::System, u0::$uType, tspan, p::$pType; kw...)
7677
ctor = string($T)
7778
pT = string($(QuoteNode(pType)))
@@ -152,6 +153,7 @@ for T in [:NonlinearProblem, :NonlinearLeastSquaresProblem,
152153
end
153154
end
154155
for pType in [SciMLBase.NullParameters, Nothing], uType in [Any, Nothing]
156+
155157
@eval function SciMLBase.$T(sys::System, u0::$uType, p::$pType; kw...)
156158
ctor = string($T)
157159
pT = string($(QuoteNode(pType)))

src/inputoutput.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function same_or_inner_namespace(u, var)
120120
nu == nv || # namespaces are the same
121121
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namespace to nu
122122
occursin(NAMESPACE_SEPARATOR, string(getname(var))) &&
123-
!occursin(NAMESPACE_SEPARATOR, string(getname(u))) # or u is top level but var is internal
123+
!occursin(NAMESPACE_SEPARATOR, string(getname(u))) # or u is top level but var is internal
124124
end
125125

126126
function inner_namespace(u, var)
@@ -129,7 +129,7 @@ function inner_namespace(u, var)
129129
nu == nv && return false
130130
startswith(nv, nu) || # or nv starts with nu, i.e., nv is an inner namespace to nu
131131
occursin(NAMESPACE_SEPARATOR, string(getname(var))) &&
132-
!occursin(NAMESPACE_SEPARATOR, string(getname(u))) # or u is top level but var is internal
132+
!occursin(NAMESPACE_SEPARATOR, string(getname(u))) # or u is top level but var is internal
133133
end
134134

135135
"""

src/structural_transformation/bareiss.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ end
131131

132132
function bareiss_update!(zero!, M::StridedMatrix, k, swapto, pivot, prev_pivot)
133133
@inbounds for i in (k + 1):size(M, 2), j in (k + 1):size(M, 1)
134+
134135
M[j, i] = exactdiv(M[j, i] * pivot - M[j, k] * M[k, i], prev_pivot)
135136
end
136137
zero!(M, (k + 1):size(M, 1), k)
@@ -269,6 +270,7 @@ function reduce_echelon!(A::AbstractMatrix{T}, rank, d,
269270
end
270271
@label out
271272
@inbounds for i in (rank + 1):m, j in 1:n
273+
272274
A[i, j] = zero(T)
273275
end
274276
isreduced && return A

0 commit comments

Comments
 (0)