Skip to content

Commit 0ff8761

Browse files
authored
Build documentation more strictly (#239)
1 parent 45226b0 commit 0ff8761

File tree

11 files changed

+48
-17
lines changed

11 files changed

+48
-17
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "KernelFunctions"
22
uuid = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
3-
version = "0.8.17"
3+
version = "0.8.18"
44

55
[deps]
66
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
34

45
[compat]
56
Documenter = "0.23, 0.24, 0.25, 0.26"
7+
PDMats = "0.10"

docs/make.jl

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
using Documenter
2+
3+
# Print `@debug` statements (https://github.com/JuliaDocs/Documenter.jl/issues/955)
4+
if haskey(ENV, "GITHUB_ACTIONS")
5+
ENV["JULIA_DEBUG"] = "Documenter"
6+
end
7+
28
using KernelFunctions
39

410
DocMeta.setdocmeta!(
511
KernelFunctions,
612
:DocTestSetup,
7-
:(using KernelFunctions, LinearAlgebra, Random);
13+
quote
14+
using KernelFunctions
15+
using LinearAlgebra
16+
using Random
17+
using PDMats: PDMats
18+
end;
819
recursive=true,
920
)
1021

@@ -14,15 +25,17 @@ makedocs(;
1425
modules=[KernelFunctions],
1526
pages=[
1627
"Home" => "index.md",
17-
"User Guide" => "userguide.md",
18-
"Examples" => "example.md",
19-
"Kernel Functions" => "kernels.md",
20-
"Input Transforms" => "transform.md",
21-
"Metrics" => "metrics.md",
22-
"Theory" => "theory.md",
23-
"Custom Kernels" => "create_kernel.md",
28+
"userguide.md",
29+
"kernels.md",
30+
"transform.md",
31+
"metrics.md",
32+
"theory.md",
33+
"create_kernel.md",
2434
"API" => "api.md",
35+
"Examples" => "example.md",
2536
],
37+
strict=true,
38+
checkdocs=:exports,
2639
)
2740

2841
deploydocs(;

docs/src/api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ kernelmatrix!
1717
kerneldiagmatrix
1818
kerneldiagmatrix!
1919
kernelpdmat
20-
kernelkronmat
2120
nystrom
22-
transform
2321
```
2422

2523
## Utilities

docs/src/create_kernel.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Custom Kernels
2+
13
## Creating your own kernel
24

35
KernelFunctions.jl contains the most popular kernels already but you might want to make your own!

docs/src/kernels.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ of kernels together.
120120
TransformedKernel
121121
transform(::Kernel, ::Transform)
122122
transform(::Kernel, ::Real)
123-
transform(::Kernel, ::AbstractVector{<:Real})
123+
transform(::Kernel, ::AbstractVector)
124124
ScaledKernel
125125
KernelSum
126126
KernelProduct

docs/src/theory.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# Theory
2+
13
See [Uncyclopedia article](https://en.wikipedia.org/wiki/Positive-definite_kernel)

docs/src/userguide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To evaluate the kernel function on two vectors you simply call the kernel object
5252
## Creating a kernel matrix
5353

5454
Kernel matrices can be created via the `kernelmatrix` function or `kerneldiagmatrix` for only the diagonal.
55-
An important argument to give is the data layout of the input `obsdim`. It specifies whether the number of observed data points is along the first dimension (`obsdim=1`, i.e. the matrix shape is number of samples times number of features) or along the second dimension (`obsdim=2`, i.e. the matrix shape is number of features times number of samples), similarly to [Distances.jl](https://github.com/JuliaStats/Distances.jl). If not given explicitly, `obsdim` defaults to [`defaultobs`](@ref).
55+
An important argument to give is the data layout of the input `obsdim`. It specifies whether the number of observed data points is along the first dimension (`obsdim=1`, i.e. the matrix shape is number of samples times number of features) or along the second dimension (`obsdim=2`, i.e. the matrix shape is number of features times number of samples), similarly to [Distances.jl](https://github.com/JuliaStats/Distances.jl). If not given explicitly, `obsdim` defaults to `2`.
5656
For example:
5757
```julia
5858
k = SqExponentialKernel()

src/KernelFunctions.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
"""
2-
KernelFunctions. [Github](https://github.com/JuliaGaussianProcesses/KernelFunctions.jl)
3-
[Documentation](https://juliagaussianprocesses.github.io/KernelFunctions.jl/stable/)
4-
"""
51
module KernelFunctions
62

73
if !isfile(joinpath(@__DIR__, "update_v0.8.0"))

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
AxisArrays = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
33
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
4+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
45
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
56
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
67
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
@@ -17,6 +18,7 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
1718
[compat]
1819
AxisArrays = "0.4.3"
1920
Distances = "0.9, 0.10"
21+
Documenter = "0.25"
2022
FiniteDifferences = "0.10.8, 0.11, 0.12"
2123
Flux = "0.10, 0.11"
2224
ForwardDiff = "0.10"

test/runtests.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using KernelFunctions
22
using AxisArrays
33
using Distances
4+
using Documenter
45
using Kronecker
56
using LinearAlgebra
67
using PDMats
@@ -145,4 +146,19 @@ include("test_utils.jl")
145146

146147
include("generic.jl")
147148
include("zygote_adjoints.jl")
149+
150+
@testset "doctests" begin
151+
DocMeta.setdocmeta!(
152+
KernelFunctions,
153+
:DocTestSetup,
154+
quote
155+
using KernelFunctions
156+
using LinearAlgebra
157+
using Random
158+
using PDMats: PDMats
159+
end;
160+
recursive=true,
161+
)
162+
doctest(KernelFunctions)
163+
end
148164
end

0 commit comments

Comments
 (0)