Skip to content

Commit 0266b60

Browse files
authored
add docs build workflow (#787)
* add docs build workflow * fix chop docs * Add disk
1 parent e4787f2 commit 0266b60

File tree

7 files changed

+63
-14
lines changed

7 files changed

+63
-14
lines changed

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Documentation
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
- 'backport**'
9+
tags: '*'
10+
release:
11+
types: [published]
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
julia-version: [1]
19+
os: [ubuntu-latest]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: julia-actions/setup-julia@latest
23+
with:
24+
version: ${{ matrix.julia-version }}
25+
- name: Cache artifacts
26+
uses: actions/cache@v1
27+
env:
28+
cache-name: cache-artifacts
29+
with:
30+
path: ~/.julia/artifacts
31+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
32+
restore-keys: |
33+
${{ runner.os }}-test-${{ env.cache-name }}-
34+
${{ runner.os }}-test-
35+
${{ runner.os }}-
36+
- name: Install dependencies
37+
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
38+
- name: Build and deploy
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: julia --project=docs/ docs/make.jl

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ SpecialFunctions = "1.1, 2"
3535
julia = "1.6"
3636

3737
[extras]
38+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3839
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3940
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4041

4142
[targets]
42-
test = ["Test", "Random"]
43+
test = ["Documenter", "Test", "Random"]

docs/src/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using ApproxFun
44

55
# ApproxFun.jl Documentation
66

7-
ApproxFun is a package for approximating and manipulating functions, and for solving differential and integral equations.
7+
ApproxFun is a package for approximating and manipulating functions, and for solving differential and integral equations.
88

99
## Introduction
1010

@@ -20,7 +20,7 @@ Some traditional examples of bases ``\mathop{ψ}_1(x), \mathop{ψ}_2(x), …`` a
2020
2. Fourier series (for periodic functions on `0..2π`): ``1, \sin{x}, \cos{x}, \sin{2x}, …``
2121
3. Chebyshev series (for non-periodic functions on `-1..1`): ``1, x, \cos(2\arccos{x}), \cos(3\arccos{x}), …``
2222

23-
In ApproxFun, functions are represented by a `Fun` with two components: `space`, which dictates the basis and `coefficients` which is a finite vector of coefficients. Note that each `Fun` can have a different length vector of coefficients, allowing for approximation of many different functions to high accuracy.
23+
In ApproxFun, functions are represented by a `Fun` with two components: `space`, which dictates the basis and `coefficients` which is a finite vector of coefficients. Note that each `Fun` can have a different length vector of coefficients, allowing for approximation of many different functions to high accuracy.
2424

2525
The approximation by a `Fun` can be determined by a variety of methods:
2626

@@ -39,7 +39,7 @@ Fun(exp)
3939

4040
determines that `f` can be approximated to roughly machine precision using 14 coefficients. See [Constructors](usage/constructors.md) for more information.
4141

42-
(3) Manipulation of `Fun`s give new `Fun`s, where the number of coefficients is determined from the input. The simplest example is addition, which for compatible bases is just padding the vectors to the same length and adding.
42+
(3) Manipulation of `Fun`s give new `Fun`s, where the number of coefficients is determined from the input. The simplest example is addition, which for compatible bases is just padding the vectors to the same length and adding.
4343

4444
```@repl using-pkgs
4545
a = Fun(cos,Chebyshev()); ncoefficients(a)
@@ -62,7 +62,7 @@ a(0.1)*b(0.1) - (a*b)(0.1)
6262

6363
The example of multiplication highlights the importance of adaptivity: if with a fixed discretization size, operations like multiplication would lose accuracy when the true function is no longer resolved by the discretization. More complicated examples are solving differential equations, where the coefficients of the solution can be determined adaptively, see [Equations](usage/equations.md).
6464

65-
ApproxFun supports a number of different spaces, as described in [Spaces](usage/spaces.md). A key component of ApproxFun is support for interaction between different spaces. This is crucial for efficient solution of differential equations, where linear operators are described as acting between different spaces, see [Operators](usage/operators.md).
65+
ApproxFun supports a number of different spaces, as described in [Spaces](usage/spaces.md). A key component of ApproxFun is support for interaction between different spaces. This is crucial for efficient solution of differential equations, where linear operators are described as acting between different spaces, see [Operators](usage/operators.md).
6666

6767
## Contents
6868

docs/src/internals/blocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Every space is divided into blocks, which are used to indicate, for example,
44
polynomial degree. The prototypical examples have trivial blocks,
55
for example `Taylor()` and `Chebyshev()` have blocks of length 1, as
6-
each coefficient corresponds to a higher polynomial degree.
6+
each coefficient corresponds to a higher polynomial degree.
77

88
Usually, non-trivial block lengths arise from modifications of the
99
spaces with trivial blocks. For example, `Chebyshev(0..1) ∪ Chebyshev(2..3)`
@@ -16,4 +16,4 @@ block has length 1, then 2, and so on.
1616
`blocklengths(::Space)` gives an iterator that encodes the lengths of the blocks.
1717
For trivial blocks, this will return `Ones{Int}(∞)`. For
1818
`Chebyshev(0..1) ∪ Chebyshev(2..3)` it returns `Fill(2,∞)`.
19-
For `Chebyshev() ⊗ Chebyshev()` it returns `InfiniteArrays.OneToInf()`.
19+
For `Chebyshev() ⊗ Chebyshev()` it returns `InfiniteArrays.OneToInf()`.

docs/src/library.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Curve
3030
```
3131

3232
```@docs
33-
Disk
33+
ApproxFunFourier.Disk
3434
```
3535

3636
```@docs
@@ -84,7 +84,7 @@ transform
8484
```
8585

8686
```@docs
87-
evaluate(::Space,::AbstractVector,::)
87+
evaluate
8888
```
8989

9090
```@docs
@@ -201,7 +201,6 @@ ApproxFun.values
201201
stride(::Fun)
202202
```
203203

204-
205204
## Modify a Fun
206205

207206

@@ -213,8 +212,9 @@ reverseorientation
213212
ApproxFun.setdomain
214213
```
215214

215+
216216
```@docs
217-
chop
217+
chop(::Fun, ::Any)
218218
```
219219

220220

@@ -237,7 +237,7 @@ rangespace
237237
```
238238

239239
```@docs
240-
getindex(::Operator,::,::)
240+
getindex(::Operator,::Any,::Any)
241241
```
242242

243243
```@docs
@@ -246,7 +246,7 @@ getindex(::Operator,::Fun)
246246

247247

248248
```@docs
249-
\(::Operator,::)
249+
\(::Operator,::Any)
250250
```
251251

252252
```@docs

src/docs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ stride(::Fun)
171171
## Modifiers
172172

173173
"""
174-
chop(f::Fun,tol) -> Fun
174+
chop(f::Fun,tol) -> Fun
175175
176176
reduces the number of coefficients by dropping the tail that is below the specified tolerance.
177177
"""

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
using ApproxFun, Random, Test
22
import ApproxFunBase: testbandedblockbandedoperator, blocklengths, ∞
33

4+
using Documenter
5+
DocMeta.setdocmeta!(ApproxFun, :DocTestSetup, :(using ApproxFun); recursive=true)
6+
7+
@testset "doctests" begin
8+
doctest(ApproxFun, manual = false)
9+
end
10+
411
@time include("ReadmeTest.jl")
512
@time include("ExtrasTest.jl")
613
@time include("NumberTypeTest.jl")

0 commit comments

Comments
 (0)