Skip to content

Commit 8aff195

Browse files
committed
feat: complete documentation overhaul and API improvements
- Add comprehensive manual sections for modeling, solving, and solutions - Implement flow API documentation with visual diagrams - Add example problems (double integrator energy/time minimization) - Improve API documentation with reexports and clear structure - Add custom CSS and assets for better documentation presentation - Enhance solve functionality with mode detection and explicit methods - Update imports and helper functions for better organization
1 parent 117d607 commit 8aff195

31 files changed

Lines changed: 3855 additions & 40 deletions

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
1818
MarkdownAST = "d0879d2d-cac2-40c8-9cee-1863dc0c7391"
1919
NLPModelsIpopt = "f4238b75-b362-5c4c-b852-0801c9a21d71"
2020
NLPModelsKnitro = "bec4dd0d-7755-52d5-9a02-22f0ffc7efcb"
21+
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
2122
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
2223
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2324

@@ -41,6 +42,7 @@ MadNLP = "0.9"
4142
MarkdownAST = "0.1"
4243
NLPModelsIpopt = "0.11"
4344
NLPModelsKnitro = "0.10"
45+
NonlinearSolve = "4"
4446
OrdinaryDiffEq = "6"
4547
Plots = "1"
4648
julia = "1.10"

docs/make.jl

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
push!(LOAD_PATH, joinpath(@__DIR__, "..", "src"))
2+
push!(LOAD_PATH, @__DIR__)
3+
14
# control-toolbox packages
25
using OptimalControl
36
using CTBase
@@ -142,7 +145,15 @@ cp(
142145
# ═══════════════════════════════════════════════════════════════════════════════
143146
# Configuration
144147
# ═══════════════════════════════════════════════════════════════════════════════
145-
draft = false # Draft mode: if true, @example blocks in markdown are not executed
148+
# if draft is true, then the julia code from .md is not executed
149+
# to disable the draft mode in a specific markdown file, use the following:
150+
#=
151+
```@meta
152+
Draft = false
153+
```
154+
=#
155+
draft = true # Draft mode: if true, @example blocks in markdown are not executed
156+
146157

147158
# ═══════════════════════════════════════════════════════════════════════════════
148159
# Load extensions
@@ -184,6 +195,7 @@ with_api_reference(src_dir, ext_dir) do api_pages
184195
assets=[
185196
asset("https://control-toolbox.org/assets/css/documentation.css"),
186197
asset("https://control-toolbox.org/assets/js/documentation.js"),
198+
"assets/custom.css",
187199
],
188200
size_threshold_ignore=[
189201
joinpath("api", "private.md"),
@@ -192,6 +204,25 @@ with_api_reference(src_dir, ext_dir) do api_pages
192204
),
193205
pages=[
194206
"Introduction" => "index.md",
207+
"Basic Examples" => [
208+
"Energy minimisation" => "example-double-integrator-energy.md",
209+
"Time mininimisation" => "example-double-integrator-time.md",
210+
],
211+
"Manual" => [
212+
"Define a problem" => "manual-abstract.md",
213+
"Use AI" => "manual-ai-llm.md",
214+
"Problem characteristics" => "manual-model.md",
215+
"Set an initial guess" => "manual-initial-guess.md",
216+
"Solve a problem" => "manual-solve.md",
217+
"Solve on GPU" => "manual-solve-gpu.md",
218+
"Solution characteristics" => "manual-solution.md",
219+
"Plot a solution" => "manual-plot.md",
220+
"Compute flows" => [
221+
"Flow API" => "manual-flow-api.md",
222+
"From optimal control problems" => "manual-flow-ocp.md",
223+
"From Hamiltonians and others" => "manual-flow-others.md",
224+
],
225+
],
195226
"API Reference" => api_pages_final,
196227
],
197228
plugins=[links],

docs/src/api/public.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ Private = false
3232

3333
```@docs; canonical=true
3434
*(::CTFlowsODE.AbstractFlow)
35-
CTBase
36-
CTModels
37-
ExaModels
3835
Flow
3936
@Lie
4037
Lie

docs/src/assets/Manifest.toml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
julia_version = "1.12.1"
44
manifest_format = "2.0"
5-
project_hash = "8a4c4ca2e610a5f7734b7c2a23e34660ca013b15"
5+
project_hash = "89e55d3e7558f944543703effd0ecaef285c9b7d"
66

77
[[deps.ADNLPModels]]
88
deps = ["ADTypes", "ForwardDiff", "LinearAlgebra", "NLPModels", "Requires", "ReverseDiff", "SparseArrays", "SparseConnectivityTracer", "SparseMatrixColorings"]
@@ -192,9 +192,9 @@ version = "0.2.7"
192192

193193
[[deps.CTBase]]
194194
deps = ["DocStringExtensions"]
195-
git-tree-sha1 = "712257c9cd7247ba4d2b53ba7baa521e5ebc37a9"
195+
git-tree-sha1 = "839532889c345a2c9384aaf6cb6bf4095d7fc9c4"
196196
uuid = "54762871-cc72-4466-b8e8-f6c8b58076cd"
197-
version = "0.18.4"
197+
version = "0.18.5"
198198

199199
[deps.CTBase.extensions]
200200
CoveragePostprocessing = ["Coverage"]
@@ -210,9 +210,9 @@ version = "0.18.4"
210210

211211
[[deps.CTDirect]]
212212
deps = ["ADNLPModels", "CTModels", "CTSolvers", "DocStringExtensions", "ExaModels", "SolverCore", "SparseArrays"]
213-
git-tree-sha1 = "26438db2f4502f23b8beb99d740c2e9cd152aef7"
213+
git-tree-sha1 = "9d9c1c5c1d17cc02692378ae49d03e90b0e469e8"
214214
uuid = "790bbbee-bee9-49ee-8912-a9de031322d5"
215-
version = "1.0.3-beta"
215+
version = "1.0.5"
216216

217217
[[deps.CTFlows]]
218218
deps = ["CTBase", "CTModels", "DocStringExtensions", "ForwardDiff", "LinearAlgebra", "MLStyle", "MacroTools"]
@@ -226,9 +226,9 @@ weakdeps = ["OrdinaryDiffEq"]
226226

227227
[[deps.CTModels]]
228228
deps = ["CTBase", "DocStringExtensions", "Interpolations", "LinearAlgebra", "MLStyle", "MacroTools", "OrderedCollections", "Parameters", "RecipesBase"]
229-
git-tree-sha1 = "336bead874d55913328ecaf9d89b4e16f4899d55"
229+
git-tree-sha1 = "3153e28badddd369e2e98f973ddb1f2d765c1b2b"
230230
uuid = "34c4fa32-2049-4079-8329-de33c2a22e2d"
231-
version = "0.9.3"
231+
version = "0.9.5"
232232
weakdeps = ["JLD2", "JSON3", "Plots"]
233233

234234
[deps.CTModels.extensions]
@@ -238,15 +238,15 @@ weakdeps = ["JLD2", "JSON3", "Plots"]
238238

239239
[[deps.CTParser]]
240240
deps = ["CTBase", "DocStringExtensions", "MLStyle", "OrderedCollections", "Parameters", "Unicode"]
241-
git-tree-sha1 = "fd19ed996fd49cbf292717ee73c031558fa86e44"
241+
git-tree-sha1 = "133dec3dee907d4a03580811ad5d7c3778728227"
242242
uuid = "32681960-a1b1-40db-9bff-a1ca817385d1"
243-
version = "0.8.5-beta"
243+
version = "0.8.7"
244244

245245
[[deps.CTSolvers]]
246246
deps = ["ADNLPModels", "CTBase", "CTModels", "CommonSolve", "DocStringExtensions", "ExaModels", "KernelAbstractions", "NLPModels", "SolverCore"]
247-
git-tree-sha1 = "7627f2b32e54bef1d86bef052127e7d5a3d3d905"
247+
git-tree-sha1 = "24f64eb8854afbe8f2360cbd6543a839c2b4ebe6"
248248
uuid = "d3e8d392-8e4b-4d9b-8e92-d7d4e3650ef6"
249-
version = "0.4.4"
249+
version = "0.4.5"
250250

251251
[deps.CTSolvers.extensions]
252252
CTSolversCUDA = "CUDA"
@@ -1685,12 +1685,6 @@ git-tree-sha1 = "1346c9208249809840c91b26703912dff463d335"
16851685
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
16861686
version = "0.5.6+0"
16871687

1688-
[[deps.OptimalControl]]
1689-
deps = ["ADNLPModels", "CTBase", "CTDirect", "CTFlows", "CTModels", "CTParser", "CTSolvers", "CommonSolve", "DocStringExtensions", "ExaModels", "NLPModels", "RecipesBase", "Reexport", "SolverCore"]
1690-
path = "/Users/ocots/Research/logiciels/dev/control-toolbox/OptimalControl"
1691-
uuid = "5f98b655-cc9a-415a-b60e-744165666948"
1692-
version = "1.2.3-beta"
1693-
16941688
[[deps.Opus_jll]]
16951689
deps = ["Artifacts", "JLLWrappers", "Libdl"]
16961690
git-tree-sha1 = "e2bb57a313a74b8104064b7efd01406c0a50d2ff"

docs/src/assets/Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ MadNLP = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6"
1818
MarkdownAST = "d0879d2d-cac2-40c8-9cee-1863dc0c7391"
1919
NLPModelsIpopt = "f4238b75-b362-5c4c-b852-0801c9a21d71"
2020
NLPModelsKnitro = "bec4dd0d-7755-52d5-9a02-22f0ffc7efcb"
21-
OptimalControl = "5f98b655-cc9a-415a-b60e-744165666948"
21+
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
2222
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
2323
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2424

@@ -42,6 +42,7 @@ MadNLP = "0.9"
4242
MarkdownAST = "0.1"
4343
NLPModelsIpopt = "0.11"
4444
NLPModelsKnitro = "0.10"
45+
NonlinearSolve = "4"
4546
OrdinaryDiffEq = "6"
4647
Plots = "1"
4748
julia = "1.10"

0 commit comments

Comments
 (0)