Skip to content

Commit 41c3a2c

Browse files
Merge pull request #4647 from ChrisRackauckas-Claude/runic-format-master-d55a4aa
Run Runic on master to fix the Runic Format Check
2 parents e9d8223 + 72f44c3 commit 41c3a2c

52 files changed

Lines changed: 357 additions & 234 deletions

Some content is hidden

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

ext/MTKFMIExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ function (wrapper::Union{FMI2InstanceWrapper, FMI3InstanceWrapper})(
830830
y = outputs_buffer, y_refs = wrapper.output_value_references
831831
)
832832
wrapper.res_buffer[1:length(states_buffer)] .= states_buffer
833-
wrapper.res_buffer[length(states_buffer)+1:end] .= outputs_buffer
833+
wrapper.res_buffer[(length(states_buffer) + 1):end] .= outputs_buffer
834834
return wrapper.res_buffer
835835
end
836836

ext/MTKOrdinaryDiffEqBDFExt.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ using ModelingToolkit: t_nounits, D_nounits
99
@parameters a = 1.0 b = 1.0
1010
@variables x(t_nounits) y(t_nounits)
1111
prob = ODEProblem(
12-
mtkcompile(System([D_nounits(x) ~ a * y, D_nounits(y) ~ -b * x],
13-
t_nounits; name = :precompile_bdf)),
14-
[x => 1.0, y => 0.0], (0.0, 1.0))
12+
mtkcompile(
13+
System(
14+
[D_nounits(x) ~ a * y, D_nounits(y) ~ -b * x],
15+
t_nounits; name = :precompile_bdf
16+
)
17+
),
18+
[x => 1.0, y => 0.0], (0.0, 1.0)
19+
)
1520
@compile_workload begin
1621
solve(prob, FBDF())
1722
end

ext/MTKOrdinaryDiffEqDefaultExt.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ using ModelingToolkit: t_nounits, D_nounits
99
@parameters a = 1.0 b = 1.0
1010
@variables x(t_nounits) y(t_nounits)
1111
prob = ODEProblem(
12-
mtkcompile(System([D_nounits(x) ~ a * y, D_nounits(y) ~ -b * x],
13-
t_nounits; name = :precompile_default)),
14-
[x => 1.0, y => 0.0], (0.0, 1.0))
12+
mtkcompile(
13+
System(
14+
[D_nounits(x) ~ a * y, D_nounits(y) ~ -b * x],
15+
t_nounits; name = :precompile_default
16+
)
17+
),
18+
[x => 1.0, y => 0.0], (0.0, 1.0)
19+
)
1520
@compile_workload begin
1621
solve(prob)
1722
end

ext/MTKOrdinaryDiffEqRosenbrockExt.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ using ModelingToolkit: t_nounits, D_nounits
99
@parameters a = 1.0 b = 1.0
1010
@variables x(t_nounits) y(t_nounits)
1111
prob = ODEProblem(
12-
mtkcompile(System([D_nounits(x) ~ a * y, D_nounits(y) ~ -b * x],
13-
t_nounits; name = :precompile_rosenbrock)),
14-
[x => 1.0, y => 0.0], (0.0, 1.0))
12+
mtkcompile(
13+
System(
14+
[D_nounits(x) ~ a * y, D_nounits(y) ~ -b * x],
15+
t_nounits; name = :precompile_rosenbrock
16+
)
17+
),
18+
[x => 1.0, y => 0.0], (0.0, 1.0)
19+
)
1520
@compile_workload begin
1621
solve(prob, Rodas5P())
1722
end

lib/ModelingToolkitBase/ext/MTKCasADiDynamicOptExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function MTK.set_variable_bounds!(m::CasADiModel, sys, pmap, tf, tunable_params,
170170
subject_to!(m.model, m.P[i] >= lo)
171171
subject_to!(m.model, m.P[i] <= hi)
172172
end
173-
if !isnothing(tf_bounds)
173+
return if !isnothing(tf_bounds)
174174
subject_to!(m.model, m.tₛ >= tf_bounds[1])
175175
subject_to!(m.model, m.tₛ <= tf_bounds[2])
176176
end

lib/ModelingToolkitBase/ext/MTKInfiniteOptExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ function MTK.set_variable_bounds!(m::InfiniteOptModel, sys, pmap, tf, tunable_pa
129129
set_lower_bound(m.P[i], lo)
130130
set_upper_bound(m.P[i], hi)
131131
end
132-
if !isnothing(tf_bounds)
132+
return if !isnothing(tf_bounds)
133133
set_lower_bound(m.tₛ, tf_bounds[1])
134134
set_upper_bound(m.tₛ, tf_bounds[2])
135135
end

lib/ModelingToolkitBase/ext/MTKPyomoDynamicOptExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function MTK.set_variable_bounds!(m::PyomoDynamicOptModel, sys, pmap, tf, tunabl
194194
MTK.add_constraint!(m, p_var lo)
195195
MTK.add_constraint!(m, p_var hi)
196196
end
197-
if !isnothing(tf_bounds)
197+
return if !isnothing(tf_bounds)
198198
tₛ_sym = pysym_getproperty(m.model_sym, :tₛ)
199199
MTK.add_constraint!(m, tₛ_sym tf_bounds[1])
200200
MTK.add_constraint!(m, tₛ_sym tf_bounds[2])

lib/ModelingToolkitBase/ext/MTKTrackerExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ function MTKBase.promote_type_with_nothing(::Type{Tracker.TrackedReal{T}}, x::Tr
88
end
99

1010
function MTKBase.promote_with_nothing(::Type{Tracker.TrackedReal{T}}, x::Tracker.TrackedArray{T}) where {T}
11-
return x
11+
return x
1212
end
1313

1414
function MTKBase.__iip_u0_ad_wrapper(u0::Tracker.TrackedVector)
15-
convert(Vector{eltype(u0)}, u0)
15+
return convert(Vector{eltype(u0)}, u0)
1616
end
1717

1818
end

lib/ModelingToolkitBase/src/ModelingToolkitBase.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $(DocStringExtensions.README)
44
module ModelingToolkitBase
55

66
if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@max_methods"))
7-
@eval Base.Experimental.@compiler_options max_methods=1
7+
@eval Base.Experimental.@compiler_options max_methods = 1
88
end
99

1010
using PrecompileTools, Reexport

lib/ModelingToolkitBase/src/derivative_dict.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,3 @@ for T in [:DerivativeDict, :ExpandDerivativeDict]
8989

9090
end
9191
end
92-

0 commit comments

Comments
 (0)