Skip to content

Commit 7a66e2e

Browse files
Merge pull request #452 from sathvikbhagavan/sb/doc1
Update makedocs syntax and few cleanups
2 parents 665b85d + a9c4fa0 commit 7a66e2e

File tree

30 files changed

+452
-377
lines changed

30 files changed

+452
-377
lines changed

.github/workflows/CI.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
- Core
1616
version:
1717
- '1'
18-
- '1.6'
1918
steps:
2019
- uses: actions/checkout@v4
2120
- uses: julia-actions/setup-julia@v1

docs/make.jl

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ using Plots
1010
include("pages.jl")
1111

1212
makedocs(sitename = "Surrogates.jl",
13-
strict = [
14-
:doctest,
15-
:linkcheck,
16-
:parse_error,
17-
:example_block,
18-
# Other available options are
19-
# :autodocs_block, :cross_references, :docs_block, :eval_block, :example_block, :footnote, :meta_block, :missing_docs, :setup_block
20-
],
21-
format = Documenter.HTML(analytics = "UA-90474609-3",
22-
assets = ["assets/favicon.ico"],
23-
canonical = "https://docs.sciml.ai/Surrogates/stable/"),
24-
pages = pages)
13+
linkcheck = true,
14+
warnonly = [:missing_docs],
15+
format = Documenter.HTML(analytics = "UA-90474609-3",
16+
assets = ["assets/favicon.ico"],
17+
canonical = "https://docs.sciml.ai/Surrogates/stable/"),
18+
pages = pages)
2519

2620
deploydocs(repo = "github.com/SciML/Surrogates.jl.git")

docs/pages.jl

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
pages = ["index.md"
2-
"Tutorials" => [
3-
"Basics" => "tutorials.md",
4-
"Radials" => "radials.md",
5-
"Kriging" => "kriging.md",
6-
"Gaussian Process" => "abstractgps.md",
7-
"Lobachevsky" => "lobachevsky.md",
8-
"Linear" => "LinearSurrogate.md",
9-
"InverseDistance" => "InverseDistance.md",
10-
"RandomForest" => "randomforest.md",
11-
"SecondOrderPolynomial" => "secondorderpoly.md",
12-
"NeuralSurrogate" => "neural.md",
13-
"Wendland" => "wendland.md",
14-
"Polynomial Chaos" => "polychaos.md",
15-
"Variable Fidelity" => "variablefidelity.md",
16-
"Gradient Enhanced Kriging" => "gek.md",
17-
"GEKPLS" => "gekpls.md",
18-
"MOE" => "moe.md",
19-
"Parallel Optimization" => "parallel.md"
20-
]
21-
"User guide" => [
22-
"Samples" => "samples.md",
23-
"Surrogates" => "surrogate.md",
24-
"Optimization" => "optimizations.md",
25-
]
26-
"Benchmarks" => [
27-
"Sphere function" => "sphere_function.md",
28-
"Lp norm" => "lp.md",
29-
"Rosenbrock" => "rosenbrock.md",
30-
"Tensor product" => "tensor_prod.md",
31-
"Cantilever beam" => "cantilever.md",
32-
"Water Flow function" => "water_flow.md",
33-
"Welded beam function" => "welded_beam.md",
34-
"Branin function" => "BraninFunction.md",
35-
"Ackley function" => "ackley.md",
36-
"Gramacy & Lee Function" => "gramacylee.md",
37-
"Salustowicz Benchmark" => "Salustowicz.md",
38-
"Multi objective optimization" => "multi_objective_opt.md",
39-
]]
2+
"Tutorials" => [
3+
"Basics" => "tutorials.md",
4+
"Radials" => "radials.md",
5+
"Kriging" => "kriging.md",
6+
"Gaussian Process" => "abstractgps.md",
7+
"Lobachevsky" => "lobachevsky.md",
8+
"Linear" => "LinearSurrogate.md",
9+
"InverseDistance" => "InverseDistance.md",
10+
"RandomForest" => "randomforest.md",
11+
"SecondOrderPolynomial" => "secondorderpoly.md",
12+
"NeuralSurrogate" => "neural.md",
13+
"Wendland" => "wendland.md",
14+
"Polynomial Chaos" => "polychaos.md",
15+
"Variable Fidelity" => "variablefidelity.md",
16+
"Gradient Enhanced Kriging" => "gek.md",
17+
"GEKPLS" => "gekpls.md",
18+
"MOE" => "moe.md",
19+
"Parallel Optimization" => "parallel.md",
20+
]
21+
"User guide" => [
22+
"Samples" => "samples.md",
23+
"Surrogates" => "surrogate.md",
24+
"Optimization" => "optimizations.md",
25+
]
26+
"Benchmarks" => [
27+
"Sphere function" => "sphere_function.md",
28+
"Lp norm" => "lp.md",
29+
"Rosenbrock" => "rosenbrock.md",
30+
"Tensor product" => "tensor_prod.md",
31+
"Cantilever beam" => "cantilever.md",
32+
"Water Flow function" => "water_flow.md",
33+
"Welded beam function" => "welded_beam.md",
34+
"Branin function" => "BraninFunction.md",
35+
"Ackley function" => "ackley.md",
36+
"Gramacy & Lee Function" => "gramacylee.md",
37+
"Salustowicz Benchmark" => "Salustowicz.md",
38+
"Multi objective optimization" => "multi_objective_opt.md",
39+
]]

docs/src/index.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -113,56 +113,59 @@ surrogate_optimize(f,SRBF(),lb,ub,my_lobachevsky,RandomSample())
113113
value = my_lobachevsky(5.0)
114114
```
115115
## Reproducibility
116+
116117
```@raw html
117118
<details><summary>The documentation of this SciML package was built using these direct dependencies,</summary>
118119
```
120+
119121
```@example
120122
using Pkg # hide
121123
Pkg.status() # hide
122124
```
125+
123126
```@raw html
124127
</details>
125128
```
129+
126130
```@raw html
127131
<details><summary>and using this machine and Julia version.</summary>
128132
```
133+
129134
```@example
130135
using InteractiveUtils # hide
131136
versioninfo() # hide
132137
```
138+
133139
```@raw html
134140
</details>
135141
```
142+
136143
```@raw html
137144
<details><summary>A more complete overview of all dependencies and their versions is also provided.</summary>
138145
```
146+
139147
```@example
140148
using Pkg # hide
141-
Pkg.status(;mode = PKGMODE_MANIFEST) # hide
149+
Pkg.status(; mode = PKGMODE_MANIFEST) # hide
142150
```
151+
143152
```@raw html
144153
</details>
145154
```
146-
```@raw html
147-
You can also download the
148-
<a href="
149-
```
150-
```@eval
151-
using TOML
152-
version = TOML.parse(read("../../Project.toml",String))["version"]
153-
name = TOML.parse(read("../../Project.toml",String))["name"]
154-
link = "https://github.com/SciML/"*name*".jl/tree/gh-pages/v"*version*"/assets/Manifest.toml"
155-
```
156-
```@raw html
157-
">manifest</a> file and the
158-
<a href="
159-
```
155+
160156
```@eval
161157
using TOML
162-
version = TOML.parse(read("../../Project.toml",String))["version"]
163-
name = TOML.parse(read("../../Project.toml",String))["name"]
164-
link = "https://github.com/SciML/"*name*".jl/tree/gh-pages/v"*version*"/assets/Project.toml"
165-
```
166-
```@raw html
167-
">project</a> file.
158+
using Markdown
159+
version = TOML.parse(read("../../Project.toml", String))["version"]
160+
name = TOML.parse(read("../../Project.toml", String))["name"]
161+
link_manifest = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
162+
"/assets/Manifest.toml"
163+
link_project = "https://github.com/SciML/" * name * ".jl/tree/gh-pages/v" * version *
164+
"/assets/Project.toml"
165+
Markdown.parse("""You can also download the
166+
[manifest]($link_manifest)
167+
file and the
168+
[project]($link_project)
169+
file.
170+
""")
168171
```

lib/SurrogatesAbstractGPs/test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ using Surrogates: sample, SobolSample
2727
x_points = sample(5, lb, ub, SobolSample())
2828
y_points = f.(x_points)
2929
agp1D = AbstractGPSurrogate([x_points[1]], [y_points[1]],
30-
gp = GP(SqExponentialKernel()), Σy = 0.05)
30+
gp = GP(SqExponentialKernel()), Σy = 0.05)
3131
x_new = 2.5
3232
y_actual = f.(x_new)
3333
for i in 2:length(x_points)
@@ -88,7 +88,7 @@ using Surrogates: sample, SobolSample
8888
b = 6
8989
my_k_EI1 = AbstractGPSurrogate(x, y)
9090
surrogate_optimize(objective_function, EI(), a, b, my_k_EI1, RandomSample(),
91-
maxiters = 200, num_new_samples = 155)
91+
maxiters = 200, num_new_samples = 155)
9292
end
9393

9494
@testset "Optimization ND" begin

lib/SurrogatesFlux/src/SurrogatesFlux.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ NeuralSurrogate(x,y,lb,ub,model,loss,opt,n_echos)
2626
2727
"""
2828
function NeuralSurrogate(x, y, lb, ub; model = Chain(Dense(length(x[1]), 1), first),
29-
loss = (x, y) -> Flux.mse(model(x), y), opt = Descent(0.01),
30-
n_echos::Int = 1)
29+
loss = (x, y) -> Flux.mse(model(x), y), opt = Descent(0.01),
30+
n_echos::Int = 1)
3131
X = vec.(collect.(x))
3232
data = zip(X, y)
3333
ps = Flux.params(model)
@@ -59,7 +59,7 @@ function add_point!(my_n::NeuralSurrogate, x_new, y_new)
5959
end
6060
X = vec.(collect.(my_n.x))
6161
data = zip(X, my_n.y)
62-
for epoch in 1:my_n.n_echos
62+
for epoch in 1:(my_n.n_echos)
6363
Flux.train!(my_n.loss, my_n.ps, data, my_n.opt)
6464
end
6565
nothing

lib/SurrogatesFlux/test/runtests.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using SafeTestsets
1919
my_opt = Descent(0.01)
2020
n_echos = 1
2121
my_neural = NeuralSurrogate(x, y, a, b, model = my_model, loss = my_loss, opt = my_opt,
22-
n_echos = 1)
22+
n_echos = 1)
2323
my_neural_kwargs = NeuralSurrogate(x, y, a, b)
2424
add_point!(my_neural, 8.5, 20.0)
2525
add_point!(my_neural, [3.2, 3.5], [7.4, 8.0])
@@ -37,7 +37,7 @@ using SafeTestsets
3737
my_opt = Descent(0.01)
3838
n_echos = 1
3939
my_neural = NeuralSurrogate(x, y, lb, ub, model = my_model, loss = my_loss,
40-
opt = my_opt, n_echos = 1)
40+
opt = my_opt, n_echos = 1)
4141
my_neural_kwargs = NeuralSurrogate(x, y, lb, ub)
4242
my_neural((3.5, 1.49))
4343
my_neural([3.4, 1.4])
@@ -54,7 +54,7 @@ using SafeTestsets
5454
my_model = Chain(Dense(1, 2))
5555
my_loss(x, y) = Flux.mse(my_model(x), y)
5656
surrogate = NeuralSurrogate(x, y, lb, ub, model = my_model, loss = my_loss,
57-
opt = my_opt, n_echos = 1)
57+
opt = my_opt, n_echos = 1)
5858
surr_kwargs = NeuralSurrogate(x, y, lb, ub)
5959

6060
f = x -> [x[1], x[2]^2]
@@ -66,7 +66,7 @@ using SafeTestsets
6666
my_model = Chain(Dense(2, 2))
6767
my_loss(x, y) = Flux.mse(my_model(x), y)
6868
surrogate = NeuralSurrogate(x, y, lb, ub, model = my_model, loss = my_loss,
69-
opt = my_opt, n_echos = 1)
69+
opt = my_opt, n_echos = 1)
7070
surrogate_kwargs = NeuralSurrogate(x, y, lb, ub)
7171
surrogate((1.0, 2.0))
7272
x_new = (2.0, 2.0)
@@ -85,7 +85,7 @@ using SafeTestsets
8585
n_echos = 1
8686
my_neural_ND_neural = NeuralSurrogate(x, y, lb, ub)
8787
surrogate_optimize(objective_function_ND, SRBF(), lb, ub, my_neural_ND_neural,
88-
SobolSample(), maxiters = 15)
88+
SobolSample(), maxiters = 15)
8989

9090
# AD Compatibility
9191
lb = 0.0
@@ -101,7 +101,7 @@ using SafeTestsets
101101
my_opt = Descent(0.01)
102102
n_echos = 1
103103
my_neural = NeuralSurrogate(x, y, lb, ub, model = my_model, loss = my_loss,
104-
opt = my_opt, n_echos = 1)
104+
opt = my_opt, n_echos = 1)
105105
g = x -> my_neural'(x)
106106
g(3.4)
107107
end
@@ -120,7 +120,7 @@ using SafeTestsets
120120
my_opt = Descent(0.01)
121121
n_echos = 1
122122
my_neural = NeuralSurrogate(x, y, lb, ub, model = my_model, loss = my_loss,
123-
opt = my_opt, n_echos = 1)
123+
opt = my_opt, n_echos = 1)
124124
g = x -> Zygote.gradient(my_neural, x)
125125
g((2.0, 5.0))
126126
end
@@ -141,7 +141,7 @@ using SafeTestsets
141141
my_opt = Descent(0.01)
142142
n_echos = 1
143143
my_neural = NeuralSurrogate(x, y, lb, ub, model = my_model, loss = my_loss,
144-
opt = my_opt, n_echos = 1)
144+
opt = my_opt, n_echos = 1)
145145
Zygote.gradient(x -> sum(my_neural(x)), (2.0, 5.0))
146146

147147
my_rad = RadialBasis(x, y, lb, ub, rad = linearRadial())

0 commit comments

Comments
 (0)