Skip to content

Commit 3ca8e09

Browse files
authored
Merge pull request #121 from control-toolbox/auto-juliaformatter-pr
[AUTO] JuliaFormatter.jl run
2 parents d1e0b73 + 93b2f02 commit 3ca8e09

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

ext/plot_utils.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ function do_plot(
3838
do_plot_costate = :costate description && costate_style != :none
3939
do_plot_control = :control description && control_style != :none
4040
do_plot_path = :path description && path_style != :none
41-
do_plot_dual = :dual description && dual_style != :none && !isnothing(CTModels.path_constraints_dual(sol))
41+
do_plot_dual =
42+
:dual description &&
43+
dual_style != :none &&
44+
!isnothing(CTModels.path_constraints_dual(sol))
4245

4346
return (do_plot_state, do_plot_costate, do_plot_control, do_plot_path, do_plot_dual)
4447
end

src/solution.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,16 @@ function build_solution(
218218
)
219219

220220
return Solution(
221-
time_grid, times(ocp), state, control, variable, fp, objective, dual, solver_infos, ocp
221+
time_grid,
222+
times(ocp),
223+
state,
224+
control,
225+
variable,
226+
fp,
227+
objective,
228+
dual,
229+
solver_infos,
230+
ocp,
222231
)
223232
end
224233

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ include("solution_example_path_constraints.jl")
3939
@eval $test_name()
4040
end
4141
end
42-
end
42+
end

test/test_plot.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ function test_plot()
104104
@test plot(sol; layout=:group, control=:components) isa Plots.Plot
105105
@test plot(sol; layout=:group, control=:norm) isa Plots.Plot
106106
@test plot(sol; layout=:group, control=:all) isa Plots.Plot
107-
@test_throws CTBase.IncorrectArgument plot(
108-
sol; layout=:group, control=:wrong_choice
109-
)
107+
@test_throws CTBase.IncorrectArgument plot(sol; layout=:group, control=:wrong_choice)
110108

111109
#
112110
@test plot(sol; layout=:split, control=:components) isa Plots.Plot
@@ -117,9 +115,7 @@ function test_plot()
117115
@test plot(sol; layout=:split, control=:components) isa Plots.Plot
118116
@test plot(sol; layout=:split, control=:norm) isa Plots.Plot
119117
@test plot(sol; layout=:split, control=:all) isa Plots.Plot
120-
@test_throws CTBase.IncorrectArgument plot(
121-
sol; layout=:split, control=:wrong_choice
122-
)
118+
@test_throws CTBase.IncorrectArgument plot(sol; layout=:split, control=:wrong_choice)
123119

124120
#
125121
@test plot(sol; layout=:split) isa Plots.Plot

0 commit comments

Comments
 (0)