Skip to content

Commit 846e4c1

Browse files
authored
Add outer testset to docs and fix example (#656)
1 parent c1142a6 commit 846e4c1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/make.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ function _literate_directory(dir)
3939
end
4040

4141
if !SKIP_EXAMPLES
42-
for (root, dir, files) in walkdir(joinpath(@__DIR__, "src", "examples"))
43-
_literate_directory.(joinpath.(root, dir))
42+
Test.@testset "Examples" verbose = true begin
43+
for (root, dir, files) in walkdir(joinpath(@__DIR__, "src", "examples"))
44+
_literate_directory.(joinpath.(root, dir))
45+
end
4446
end
4547
end
4648

docs/src/examples/general_examples/worst_case_analysis.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# # Worst case risk analysis
22
# Generate data for worst-case risk analysis.
33
using Random
4-
4+
using LinearAlgebra
55
Random.seed!(2);
66
n = 5;
77
r = abs.(randn(n, 1)) / 15;
88
Sigma = 0.9 * rand(n, n) .- 0.15;
99
Sigma_nom = Sigma' * Sigma;
1010
Sigma_nom .-= (maximum(Sigma_nom) - 0.9)
11-
11+
Sigma_nom .+= (1e-4 - eigmin(Sigma_nom)) * I(n) # ensure positive-definite
1212
#-
1313

1414
# Form and solve portfolio optimization problem.

0 commit comments

Comments
 (0)