Skip to content

Commit f0cab09

Browse files
authored
Merge pull request #731 from control-toolbox/auto-juliaformatter-pr
[AUTO] JuliaFormatter.jl run
2 parents 6431c17 + 852089b commit f0cab09

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

src/helpers/print.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ function _ansi_color(color::Symbol, bold::Bool=false)
3030
:magenta => 35,
3131
:cyan => 36,
3232
:white => 37,
33-
:default => 39
33+
:default => 39,
3434
)
35-
35+
3636
code = get(color_codes, color, 39)
3737
if bold
3838
return "\033[1;$(code)m"

src/imports/ctsolvers.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ import CTSolvers:
3030
# Parameter types (imported only, not reexported)
3131
AbstractStrategyParameter
3232

33-
@reexport import CTSolvers:
34-
CPU,
35-
GPU
33+
@reexport import CTSolvers: CPU, GPU
3634

3735
@reexport import CTSolvers:
3836

test/suite/reexport/test_ctflows.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module TestCtflows
99

1010
using Test: Test
1111
using OptimalControl # using is mandatory since we test exported symbols
12-
import CTFlows # needed for abstract type checks
12+
using CTFlows: CTFlows # needed for abstract type checks
1313

1414
const VERBOSE = isdefined(Main, :TestOptions) ? Main.TestOptions.VERBOSE : true
1515
const SHOWTIMING = isdefined(Main, :TestOptions) ? Main.TestOptions.SHOWTIMING : true

test/suite/reexport/test_ctsolvers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module TestCtsolvers
1010
using Test: Test
1111
using CTSolvers: CTSolvers
1212
using OptimalControl # using is mandatory since we test exported symbols
13-
import SolverCore # needed for ocp_solution signature check
13+
using SolverCore: SolverCore # needed for ocp_solution signature check
1414

1515
const VERBOSE = isdefined(Main, :TestOptions) ? Main.TestOptions.VERBOSE : true
1616
const SHOWTIMING = isdefined(Main, :TestOptions) ? Main.TestOptions.SHOWTIMING : true

test/suite/solve/test_canonical.jl

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,34 @@ function test_canonical()
6767
modeler_solver_pairs = [
6868
# ADNLP modeler with all solvers
6969
("ADNLP", "Ipopt", OptimalControl.ADNLP(), OptimalControl.Ipopt(print_level=0)),
70-
("ADNLP", "MadNLP", OptimalControl.ADNLP(), OptimalControl.MadNLP(print_level=MadNLP.ERROR)),
70+
(
71+
"ADNLP",
72+
"MadNLP",
73+
OptimalControl.ADNLP(),
74+
OptimalControl.MadNLP(print_level=MadNLP.ERROR),
75+
),
7176
("ADNLP", "Uno", OptimalControl.ADNLP(), OptimalControl.Uno(logger="SILENT")),
72-
("ADNLP", "MadNCL", OptimalControl.ADNLP(), OptimalControl.MadNCL(print_level=MadNLP.ERROR)),
77+
(
78+
"ADNLP",
79+
"MadNCL",
80+
OptimalControl.ADNLP(),
81+
OptimalControl.MadNCL(print_level=MadNLP.ERROR),
82+
),
7383
# Exa modeler with all solvers
7484
("Exa", "Ipopt", OptimalControl.Exa(), OptimalControl.Ipopt(print_level=0)),
75-
("Exa", "MadNLP", OptimalControl.Exa(), OptimalControl.MadNLP(print_level=MadNLP.ERROR)),
85+
(
86+
"Exa",
87+
"MadNLP",
88+
OptimalControl.Exa(),
89+
OptimalControl.MadNLP(print_level=MadNLP.ERROR),
90+
),
7691
("Exa", "Uno", OptimalControl.Exa(), OptimalControl.Uno(logger="SILENT")),
77-
("Exa", "MadNCL", OptimalControl.Exa(), OptimalControl.MadNCL(print_level=MadNLP.ERROR)),
92+
(
93+
"Exa",
94+
"MadNCL",
95+
OptimalControl.Exa(),
96+
OptimalControl.MadNCL(print_level=MadNLP.ERROR),
97+
),
7898
]
7999

80100
problems = [("Beam", Beam()), ("Goddard", Goddard())]
@@ -140,10 +160,9 @@ function test_canonical()
140160
Test.@testset "$dname / $mname / $sname" begin
141161
Test.@test success
142162
if success
143-
Test.@test solve_result isa
144-
OptimalControl.AbstractSolution
145-
Test.@test OptimalControl.objective(solve_result)
146-
pb.obj rtol = OBJ_RTOL
163+
Test.@test solve_result isa OptimalControl.AbstractSolution
164+
Test.@test OptimalControl.objective(solve_result) pb.obj rtol =
165+
OBJ_RTOL
147166
end
148167
end
149168
end

0 commit comments

Comments
 (0)