Skip to content

Commit b1a6bb4

Browse files
authored
docs!: Revamp documentation (#66)
- BREAKING CHANGE: rename `plot_instance` to `plot_context`, and `plot_solution` to `plot_sample` - Global revamp of the documentation, with a complete description page for every benchmark problem. - New `Plots` extension containing the plotting code for benchmarks - New `DataSample` copy constructor - Split API page between public and private methods
1 parent 83eeb48 commit b1a6bb4

65 files changed

Lines changed: 2105 additions & 820 deletions

Some content is hidden

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

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ maximizer = generate_maximizer(bench)
2323

2424
For the full list of benchmarks, the common interface, and detailed usage examples, refer to the [documentation](https://JuliaDecisionFocusedLearning.github.io/DecisionFocusedLearningBenchmarks.jl/stable/).
2525

26+
## Installation
27+
28+
```julia
29+
using Pkg
30+
Pkg.add("DecisionFocusedLearningBenchmarks")
31+
```
32+
2633
## Related Packages
2734

2835
This package is part of the [JuliaDecisionFocusedLearning](https://github.com/JuliaDecisionFocusedLearning) organization, and built to be compatible with other packages in the ecosystem:

docs/make.jl

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ using Literate
55
md_dir = joinpath(@__DIR__, "src")
66
tutorial_dir = joinpath(@__DIR__, "src", "tutorials")
77
benchmarks_dir = joinpath(@__DIR__, "src", "benchmarks")
8-
api_dir = joinpath(@__DIR__, "src", "api")
98

109
tutorial_files = readdir(tutorial_dir)
1110
md_tutorial_files = [split(file, ".")[1] * ".md" for file in tutorial_files]
12-
benchmark_files = [joinpath("benchmarks", e) for e in readdir(benchmarks_dir)]
11+
12+
categories = [
13+
"Static problems" => "static",
14+
"Stochastic problems" => "stochastic",
15+
"Dynamic problems" => "dynamic",
16+
]
1317

1418
include_tutorial = true
1519

@@ -20,6 +24,19 @@ if include_tutorial
2024
end
2125
end
2226

27+
benchmark_sections = Pair{String,Vector{String}}[]
28+
29+
for (label, subdir) in categories
30+
dir = joinpath(benchmarks_dir, subdir)
31+
jl_files = filter(f -> endswith(f, ".jl"), readdir(dir))
32+
md_names = [splitext(f)[1] * ".md" for f in jl_files]
33+
for file in jl_files
34+
Literate.markdown(joinpath(dir, file), dir; documenter=true, execute=false)
35+
end
36+
md_paths = [joinpath("benchmarks", subdir, f) for f in md_names]
37+
push!(benchmark_sections, label => md_paths)
38+
end
39+
2340
makedocs(;
2441
modules=[DecisionFocusedLearningBenchmarks],
2542
authors="Members of JuliaDecisionFocusedLearning",
@@ -32,7 +49,7 @@ makedocs(;
3249
"Creating custom benchmarks" => "custom_benchmarks.md",
3350
],
3451
"Tutorials" => include_tutorial ? md_tutorial_files : [],
35-
"Benchmark problems list" => benchmark_files,
52+
"Benchmarks" => benchmark_sections,
3653
"API reference" => "api.md",
3754
],
3855
)
@@ -44,6 +61,13 @@ if include_tutorial
4461
end
4562
end
4663

64+
for (_, subdir) in categories
65+
dir = joinpath(benchmarks_dir, subdir)
66+
for f in filter(f -> endswith(f, ".md"), readdir(dir))
67+
rm(joinpath(dir, f); force=true)
68+
end
69+
end
70+
4771
deploydocs(;
4872
repo="github.com/JuliaDecisionFocusedLearning/DecisionFocusedLearningBenchmarks.jl",
4973
devbranch="main",

docs/src/api.md

Lines changed: 33 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,115 @@
11
# API Reference
22

3-
## Interface
3+
## Public
44

5-
```@autodocs
6-
Modules = [DecisionFocusedLearningBenchmarks.Utils]
7-
Private = false
8-
```
5+
### Interface
96

107
```@autodocs
118
Modules = [DecisionFocusedLearningBenchmarks.Utils]
12-
Public = false
9+
Private = false
1310
```
1411

15-
## Argmax2D
12+
### Argmax2D
1613

1714
```@autodocs
1815
Modules = [DecisionFocusedLearningBenchmarks.Argmax2D]
1916
Private = false
2017
```
2118

22-
```@autodocs
23-
Modules = [DecisionFocusedLearningBenchmarks.Argmax2D]
24-
Public = false
25-
```
26-
27-
## Argmax
19+
### Argmax
2820

2921
```@autodocs
3022
Modules = [DecisionFocusedLearningBenchmarks.Argmax]
3123
Private = false
3224
```
3325

34-
```@autodocs
35-
Modules = [DecisionFocusedLearningBenchmarks.Argmax]
36-
Public = false
37-
```
38-
39-
## Contextual Stochastic Argmax
26+
### Contextual Stochastic Argmax
4027

4128
```@autodocs
4229
Modules = [DecisionFocusedLearningBenchmarks.ContextualStochasticArgmax]
4330
Private = false
4431
```
4532

46-
```@autodocs
47-
Modules = [DecisionFocusedLearningBenchmarks.ContextualStochasticArgmax]
48-
Public = false
49-
```
50-
51-
## Dynamic Vehicle Scheduling
33+
### Dynamic Vehicle Scheduling
5234

5335
```@autodocs
5436
Modules = [DecisionFocusedLearningBenchmarks.DynamicVehicleScheduling]
5537
Private = false
5638
```
5739

58-
```@autodocs
59-
Modules = [DecisionFocusedLearningBenchmarks.DynamicVehicleScheduling]
60-
Public = false
61-
```
62-
63-
## Dynamic Assortment
40+
### Dynamic Assortment
6441

6542
```@autodocs
6643
Modules = [DecisionFocusedLearningBenchmarks.DynamicAssortment]
6744
Private = false
6845
```
6946

70-
```@autodocs
71-
Modules = [DecisionFocusedLearningBenchmarks.DynamicAssortment]
72-
Public = false
73-
```
74-
75-
## Fixed-size shortest path
47+
### Fixed-size shortest path
7648

7749
```@autodocs
7850
Modules = [DecisionFocusedLearningBenchmarks.FixedSizeShortestPath]
7951
Private = false
8052
```
8153

82-
```@autodocs
83-
Modules = [DecisionFocusedLearningBenchmarks.FixedSizeShortestPath]
84-
Public = false
85-
```
86-
87-
## Maintenance
54+
### Maintenance
8855

8956
```@autodocs
9057
Modules = [DecisionFocusedLearningBenchmarks.Maintenance]
9158
Private = false
9259
```
9360

94-
```@autodocs
95-
Modules = [DecisionFocusedLearningBenchmarks.Maintenance]
96-
Public = false
97-
```
98-
99-
## Portfolio Optimization
61+
### Portfolio Optimization
10062

10163
```@autodocs
10264
Modules = [DecisionFocusedLearningBenchmarks.PortfolioOptimization]
10365
Private = false
10466
```
10567

106-
```@autodocs
107-
Modules = [DecisionFocusedLearningBenchmarks.PortfolioOptimization]
108-
Public = false
109-
```
110-
111-
## Ranking
68+
### Ranking
11269

11370
```@autodocs
11471
Modules = [DecisionFocusedLearningBenchmarks.Ranking]
11572
Private = false
11673
```
11774

118-
```@autodocs
119-
Modules = [DecisionFocusedLearningBenchmarks.Ranking]
120-
Public = false
121-
```
122-
123-
## Subset selection
75+
### Subset selection
12476

12577
```@autodocs
12678
Modules = [DecisionFocusedLearningBenchmarks.SubsetSelection]
12779
Private = false
12880
```
12981

130-
```@autodocs
131-
Modules = [DecisionFocusedLearningBenchmarks.SubsetSelection]
132-
Public = false
133-
```
134-
135-
## Stochastic Vehicle Scheduling
82+
### Stochastic Vehicle Scheduling
13683

13784
```@autodocs
13885
Modules = [DecisionFocusedLearningBenchmarks.StochasticVehicleScheduling]
13986
Private = false
14087
```
14188

142-
```@autodocs
143-
Modules = [DecisionFocusedLearningBenchmarks.StochasticVehicleScheduling]
144-
Public = false
145-
```
146-
147-
## Warcraft
89+
### Warcraft
14890

14991
```@autodocs
15092
Modules = [DecisionFocusedLearningBenchmarks.Warcraft]
15193
Private = false
15294
```
15395

154-
```@autodocs
155-
Modules = [DecisionFocusedLearningBenchmarks.Warcraft]
96+
## Internals
97+
98+
```@autodocs
99+
Modules = [
100+
DecisionFocusedLearningBenchmarks.Utils,
101+
DecisionFocusedLearningBenchmarks.Argmax,
102+
DecisionFocusedLearningBenchmarks.Argmax2D,
103+
DecisionFocusedLearningBenchmarks.ContextualStochasticArgmax,
104+
DecisionFocusedLearningBenchmarks.DynamicVehicleScheduling,
105+
DecisionFocusedLearningBenchmarks.DynamicAssortment,
106+
DecisionFocusedLearningBenchmarks.FixedSizeShortestPath,
107+
DecisionFocusedLearningBenchmarks.Maintenance,
108+
DecisionFocusedLearningBenchmarks.PortfolioOptimization,
109+
DecisionFocusedLearningBenchmarks.Ranking,
110+
DecisionFocusedLearningBenchmarks.SubsetSelection,
111+
DecisionFocusedLearningBenchmarks.StochasticVehicleScheduling,
112+
DecisionFocusedLearningBenchmarks.Warcraft,
113+
]
156114
Public = false
157115
```

docs/src/benchmarks/argmax.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/src/benchmarks/contextual_stochastic_argmax.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)