Skip to content

Commit 9501dc4

Browse files
ocotsgithub-actions[bot]
authored andcommitted
🤖 Format .jl files
1 parent a2c56fa commit 9501dc4

34 files changed

Lines changed: 173 additions & 232 deletions

docs/make.jl

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,16 @@ makedocs(;
9393
# ───────────────────────────────────────────────────────────────────
9494
CTBase.automatic_reference_documentation(;
9595
subdirectory=".",
96-
primary_modules=[CTModels => src(
97-
"core/types.jl",
98-
"core/types/ocp_model.jl",
99-
"core/types/ocp_components.jl",
100-
"core/types/ocp_solution.jl",
101-
"core/types/initial_guess.jl",
102-
"core/types/nlp.jl",
103-
)],
96+
primary_modules=[
97+
CTModels => src(
98+
"core/types.jl",
99+
"core/types/ocp_model.jl",
100+
"core/types/ocp_components.jl",
101+
"core/types/ocp_solution.jl",
102+
"core/types/initial_guess.jl",
103+
"core/types/nlp.jl",
104+
),
105+
],
104106
exclude=EXCLUDE_SYMBOLS,
105107
public=false,
106108
private=true,
@@ -126,11 +128,13 @@ makedocs(;
126128
# ───────────────────────────────────────────────────────────────────
127129
CTBase.automatic_reference_documentation(;
128130
subdirectory=".",
129-
primary_modules=[CTModels => src(
130-
"ocp/model.jl",
131-
"ocp/definition.jl",
132-
"ocp/time_dependence.jl",
133-
)],
131+
primary_modules=[
132+
CTModels => src(
133+
"ocp/model.jl",
134+
"ocp/definition.jl",
135+
"ocp/time_dependence.jl",
136+
),
137+
],
134138
exclude=EXCLUDE_SYMBOLS,
135139
public=false,
136140
private=true,
@@ -156,7 +160,9 @@ makedocs(;
156160
# ───────────────────────────────────────────────────────────────────
157161
CTBase.automatic_reference_documentation(;
158162
subdirectory=".",
159-
primary_modules=[CTModels => src("ocp/state.jl", "ocp/control.jl", "ocp/variable.jl")],
163+
primary_modules=[
164+
CTModels => src("ocp/state.jl", "ocp/control.jl", "ocp/variable.jl")
165+
],
160166
exclude=EXCLUDE_SYMBOLS,
161167
public=false,
162168
private=true,
@@ -234,13 +240,15 @@ makedocs(;
234240
# ───────────────────────────────────────────────────────────────────
235241
CTBase.automatic_reference_documentation(;
236242
subdirectory=".",
237-
primary_modules=[CTModels => src(
238-
"nlp/nlp_backends.jl",
239-
"nlp/options_schema.jl",
240-
"nlp/problem_core.jl",
241-
"nlp/discretized_ocp.jl",
242-
"nlp/model_api.jl",
243-
)],
243+
primary_modules=[
244+
CTModels => src(
245+
"nlp/nlp_backends.jl",
246+
"nlp/options_schema.jl",
247+
"nlp/problem_core.jl",
248+
"nlp/discretized_ocp.jl",
249+
"nlp/model_api.jl",
250+
),
251+
],
244252
exclude=EXCLUDE_SYMBOLS,
245253
public=false,
246254
private=true,
@@ -253,12 +261,14 @@ makedocs(;
253261
# ───────────────────────────────────────────────────────────────────
254262
CTBase.automatic_reference_documentation(;
255263
subdirectory=".",
256-
primary_modules=[CTModelsPlots => ext(
257-
"CTModelsPlots.jl",
258-
"plot.jl",
259-
"plot_default.jl",
260-
"plot_utils.jl",
261-
)],
264+
primary_modules=[
265+
CTModelsPlots => ext(
266+
"CTModelsPlots.jl",
267+
"plot.jl",
268+
"plot_default.jl",
269+
"plot_utils.jl",
270+
),
271+
],
262272
external_modules_to_document=[Plots],
263273
exclude=EXCLUDE_SYMBOLS,
264274
public=false,

src/CTModels.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,4 @@ include(joinpath(@__DIR__, "nlp", "discretized_ocp.jl"))
266266
include(joinpath(@__DIR__, "nlp", "model_api.jl"))
267267
include(joinpath(@__DIR__, "init", "initial_guess.jl"))
268268

269-
end
269+
end

src/core/types/nlp.jl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,10 @@ guess. The default implementation throws a
169169
`CTBase.NotImplemented` error.
170170
"""
171171
function (modeler::AbstractOptimizationModeler)(
172-
prob::AbstractOptimizationProblem,
173-
initial_guess;
174-
kwargs...,
172+
prob::AbstractOptimizationProblem, initial_guess; kwargs...
175173
)
176174
throw(
177-
CTBase.NotImplemented(
178-
"model-building call not implemented for $(typeof(modeler))",
179-
),
175+
CTBase.NotImplemented("model-building call not implemented for $(typeof(modeler))")
180176
)
181177
end
182178

@@ -198,7 +194,7 @@ function (modeler::AbstractOptimizationModeler)(
198194
)
199195
throw(
200196
CTBase.NotImplemented(
201-
"solution-building call not implemented for $(typeof(modeler))",
197+
"solution-building call not implemented for $(typeof(modeler))"
202198
),
203199
)
204200
end
@@ -278,13 +274,10 @@ convert NLP execution statistics into an appropriate representation. The
278274
default implementation throws a `CTBase.NotImplemented` error.
279275
"""
280276
function (builder::AbstractOCPSolutionBuilder)(
281-
nlp_solution::SolverCore.AbstractExecutionStats;
282-
kwargs...,
277+
nlp_solution::SolverCore.AbstractExecutionStats; kwargs...
283278
)
284279
throw(
285-
CTBase.NotImplemented(
286-
"OCP solution builder not implemented for $(typeof(builder))",
287-
),
280+
CTBase.NotImplemented("OCP solution builder not implemented for $(typeof(builder))")
288281
)
289282
end
290283

src/init/initial_guess.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,4 +1015,4 @@ function _build_time_dependent_init(
10151015
)
10161016
throw(CTBase.IncorrectArgument(msg))
10171017
end
1018-
end
1018+
end

src/nlp/discretized_ocp.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ function get_exa_solution_builder(prob::DiscretizedOptimalControlProblem)
108108
end
109109
end
110110
throw(ArgumentError("no :exa solution builder registered"))
111-
end
111+
end

src/nlp/model_api.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ function ocp_solution(
8787
modeler::AbstractOptimizationModeler,
8888
)::AbstractOptimalControlSolution
8989
return build_solution(docp, model_solution, modeler)
90-
end
90+
end

src/nlp/nlp_backends.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,4 @@ julia> modeler = CTModels.build_modeler_from_symbol(:adnlp)
297297
function build_modeler_from_symbol(sym::Symbol; kwargs...)
298298
T = _modeler_type_from_symbol(sym)
299299
return T(; kwargs...)
300-
end
300+
end

src/nlp/options_schema.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,4 +577,4 @@ function _build_ocp_tool_options(
577577
sources = (; src_pairs...)
578578

579579
return values, sources
580-
end
580+
end

src/nlp/problem_core.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ construct the corresponding NLP model. The default implementation throws
3737
"""
3838
function get_exa_model_builder(prob::AbstractOptimizationProblem)
3939
throw(
40-
CTBase.NotImplemented("get_exa_model_builder not implemented for $(typeof(prob))"),
40+
CTBase.NotImplemented("get_exa_model_builder not implemented for $(typeof(prob))")
4141
)
4242
end
4343

@@ -53,7 +53,7 @@ throws `CTBase.NotImplemented`.
5353
"""
5454
function get_adnlp_model_builder(prob::AbstractOptimizationProblem)
5555
throw(
56-
CTBase.NotImplemented("get_adnlp_model_builder not implemented for $(typeof(prob))"),
56+
CTBase.NotImplemented("get_adnlp_model_builder not implemented for $(typeof(prob))")
5757
)
5858
end
5959

@@ -70,7 +70,7 @@ throws `CTBase.NotImplemented`.
7070
function get_adnlp_solution_builder(prob::AbstractOptimizationProblem)
7171
throw(
7272
CTBase.NotImplemented(
73-
"get_adnlp_solution_builder not implemented for $(typeof(prob))",
73+
"get_adnlp_solution_builder not implemented for $(typeof(prob))"
7474
),
7575
)
7676
end
@@ -88,7 +88,7 @@ throws `CTBase.NotImplemented`.
8888
function get_exa_solution_builder(prob::AbstractOptimizationProblem)
8989
throw(
9090
CTBase.NotImplemented(
91-
"get_exa_solution_builder not implemented for $(typeof(prob))",
91+
"get_exa_solution_builder not implemented for $(typeof(prob))"
9292
),
9393
)
94-
end
94+
end

test/core/test_initial_guess_types.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ function test_initial_guess_types()
1717
Test.@test ig.variable === variable_vec
1818

1919
# Type parameters should reflect the concrete field types
20-
Test.@test ig isa
21-
CTModels.OptimalControlInitialGuess{typeof(state_fun),typeof(control_fun),typeof(variable_vec)}
20+
Test.@test ig isa CTModels.OptimalControlInitialGuess{
21+
typeof(state_fun),typeof(control_fun),typeof(variable_vec)
22+
}
2223
end
2324

2425
Test.@testset "OptimalControlPreInit structure" verbose=VERBOSE showtiming=SHOWTIMING begin
@@ -59,4 +60,3 @@ function test_initial_guess_types()
5960
Test.@test v == variable_val
6061
end
6162
end
62-

0 commit comments

Comments
 (0)