Skip to content

Commit 4c29ad6

Browse files
mkittiranochaederag
authored
Update README and documentation (#499)
* Update README.md, fix badges, rearrange sections, list more packages * Move Development Status to the bottom, above Contributing in README * Update documentation index.md * Add separate other packages page * Rearrange badges like documentation * Update NEWS.md * Add NEWS.md to the documentation * Given an example of performant usage in the introduction page. * Apply suggestions from @ranocha Co-authored-by: Hendrik Ranocha <[email protected]> * Simplify initial example * Update README.md Co-authored-by: ederag <[email protected]> * Update docs/src/index.md Co-authored-by: ederag <[email protected]> * Fix collocation misspelling in docs/src/other_packages.md * Add Interpolations to docs Project * Resort other packages * Move convenience construction first in docs * Add extra information on grids, scaling, and extrapolation to explain examples. * Fix cross references Co-authored-by: Hendrik Ranocha <[email protected]> Co-authored-by: ederag <[email protected]>
1 parent e561af3 commit 4c29ad6

File tree

9 files changed

+202
-56
lines changed

9 files changed

+202
-56
lines changed

NEWS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
For a comprehensive list of changes, see [Releases](https://github.com/JuliaMath/Interpolations.jl/releases).
2+
3+
# v0.14.0
4+
5+
Breaking changes:
6+
7+
## Implement inplace `GriddedInterpolation` ([#496](https://github.com/JuliaMath/Interpolations.jl/pull/496), for [#495](https://github.com/JuliaMath/Interpolations.jl/issues/495))
8+
- `interpolate` now copies the coefficients for `GriddedInterpolation`.
9+
- `interpolate!` now does not copy the coefficients for `GriddedInterpolation`.
10+
- The third argument of `GriddedInterpolation` describes the array type of the coefficients rather than the element type of `Array`.
11+
112
# v0.9.0
213

314
Breaking changes:

README.md

Lines changed: 60 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,41 @@
1-
# Interpolations
1+
# Interpolations.jl
22

3-
[![Build Status](https://travis-ci.org/JuliaMath/Interpolations.jl.svg?branch=master)](https://travis-ci.org/JuliaMath/Interpolations.jl)
4-
[![](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliamath.github.io/Interpolations.jl/latest)
5-
6-
**NEWS** This package is currently under new maintainership. Please be patient while the new maintainer learns the new package. If you would like to volunteer, please mention this in an issue.
7-
8-
**NEWS** v0.9 was a breaking release. See the [news](NEWS.md) for details on how to update.
3+
[![version](https://juliahub.com/docs/Interpolations/version.svg)](https://juliahub.com/ui/Packages/Interpolations/VpKVx)
4+
[![pkgeval](https://juliahub.com/docs/Interpolations/pkgeval.svg)](https://juliahub.com/ui/Packages/Interpolations/VpKVx)
5+
[![Build Status](https://github.com/JuliaMath/Interpolations.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaMath/Interpolations.jl/actions/workflows/CI.yml?query=branch%3Amaster)
6+
[![deps](https://juliahub.com/docs/Interpolations/deps.svg)](https://juliahub.com/ui/Packages/Interpolations/VpKVx?t=2)
7+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](http://juliamath.github.io/Interpolations.jl/stable)
8+
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliamath.github.io/Interpolations.jl/latest)
99

1010
This package implements a variety of interpolation schemes for the
1111
Julia language. It has the goals of ease-of-use, broad algorithmic
1212
support, and exceptional performance.
1313

14-
Currently this package's support is best
15-
for [B-splines](https://en.wikipedia.org/wiki/B-spline) and also
16-
supports irregular grids. However, the API has been designed with
14+
Currently this package supports
15+
[B-splines](https://en.wikipedia.org/wiki/B-spline) and also
16+
irregular grids. The API has been designed with
1717
intent to support more options. Initial support for Lanczos
1818
interpolation was recently added. Pull-requests are more than welcome!
1919
It should be noted that the API may continue to evolve over time.
2020

21-
Other interpolation packages for Julia include:
22-
- [Dierckx.jl](https://github.com/kbarbary/Dierckx.jl)
23-
- [GridInterpolations.jl](https://github.com/sisl/GridInterpolations.jl)
24-
- [ApproXD.jl](https://github.com/floswald/ApproXD.jl)
25-
- [PCHIPInterpolation.jl](https://github.com/gerlero/PCHIPInterpolation.jl) for monotonic interpolation
26-
- [DIVAnd.jl](https://github.com/gher-ulg/DIVAnd.jl) for N-dimensional smoothing interpolation
27-
28-
Some of these packages support methods that `Interpolations` does not,
29-
so if you can't find what you need here, check one of them or submit a
30-
pull request here.
31-
3221
At the bottom of this page, you can find a "performance shootout"
3322
among these methods (as well as SciPy's `RegularGridInterpolator`).
3423

35-
3624
## Installation
3725

38-
Just
26+
Interpolations.jl can be installed via the following invocation
27+
since it is a registered Julia package.
3928

4029
```julia
4130
using Pkg
4231
Pkg.add("Interpolations")
4332
```
4433

45-
from the Julia REPL.
46-
47-
4834
## Example Usage
4935
Create a grid `xs` and an array `A` of values to be interpolated
5036
```julia
5137
xs = 1:0.2:5
52-
f(x) = log(x)
53-
A = [f(x) for x in xs]
38+
A = log.(xs)
5439
```
5540
Create linear interpolation object without extrapolation
5641
```julia
@@ -71,6 +56,39 @@ More examples, such as plotting and cubic interpolation, can be found at the [co
7156

7257
![interpolation plot example](docs/src/assets/plotsjl_interpolation_example.png)
7358

59+
## Other Interpolation Packages
60+
61+
Other interpolation packages for Julia include:
62+
63+
- [ApproXD.jl](https://github.com/floswald/ApproXD.jl) implements B-spline and linear interpolation in Julia.
64+
- [BarycentricInterpolation.jl](https://github.com/dawbarton/BarycentricInterpolation.jl) implements the Barycentric formula for polynomial interpolation on equispaced points and Chebyshev points of the first and second kind.
65+
- [BasicInterpolators.jl](https://github.com/markmbaum/BasicInterpolators.jl) provides a collection of common interpolation recipes for basic applications.
66+
- [BSplineKit.jl](https://github.com/jipolanco/BSplineKit.jl) offers tools for B-spline based Galerkin and collocation methods, including for interpolation and approximation.
67+
- [Curves.jl](https://github.com/lungben/Curves.jl) supports log-interpolation via immutable `Curve` objects.
68+
- [DataInterpolations.jl](https://github.com/PumasAI/DataInterpolations.jl) is a library for performing interpolations of one-dimensional data.
69+
- [Dierckx.jl](https://github.com/kbarbary/Dierckx.jl) is a wrapper for the dierckx Fortran library, which also underlies `scipy.interpolate`.
70+
- [DIVAnd.jl](https://github.com/gher-ulg/DIVAnd.jl) for N-dimensional smoothing interpolation.
71+
- [FastChebInterp.jl](https://github.com/stevengj/FastChebInterp.jl) does fast multidimensional Chebyshev interpolation on a hypercube using separable grid of interpolation points.
72+
- [FEMBasis.jl](https://github.com/JuliaFEM/FEMBasis.jl) contains interpolation routines for standard finite element function spaces.
73+
- [FineShift.jl](https://github.com/emmt/FineShift.jl) does fast sub-sample shifting of multidimensional arrays.
74+
- [FourierTools.jl](https://github.com/bionanoimaging/FourierTools.jl) includes sinc interpolation for up and down sampling.
75+
- [GridInterpolations.jl](https://github.com/sisl/GridInterpolations.jl) performs multivariate interpolation on a rectilinear grid.
76+
- [InterpolationKernels.jl](https://github.com/emmt/InterpolationKernels.jl) provides a library of interpolation kernels.
77+
- [KissSmoothing.jl](https://github.com/francescoalemanno/KissSmoothing.jl) implements denoising and a Radial Basis Function estimation procedure.
78+
- [LinearInterpolations.jl](https://github.com/jw3126/LinearInterpolations.jl) allows for interpolation using weighted averages allowing probability distributions, rotations, and other Lie groups to be interpolated.
79+
- [LinearInterpolators.jl](https://github.com/emmt/LinearInterpolators.jl) provides linear interpolation methods for Julia based on InterpolationKernels.jl, above.
80+
- [LocalFunctionApproximation.jl](https://github.com/sisl/LocalFunctionApproximation.jl) provides local function approximators that interpolates a scalar-valued function across a vector space.
81+
- [PCHIPInterpolation.jl](https://github.com/gerlero/PCHIPInterpolation.jl) for monotonic interpolation.
82+
- [PiecewiseLinearApprox.jl](https://github.com/RJDennis/PiecewiseLinearApprox.jl) performs piecewise linear interpolation over an arbitrary number of dimensions.
83+
- [ScatteredInterpolation.jl](https://github.com/eljungsk/ScatteredInterpolation.jl) interpolates scattered data in arbitrary dimensions.
84+
85+
Some of these packages support methods that `Interpolations` does not,
86+
so if you can't find what you need here, check one of them or submit a
87+
pull request here.
88+
89+
If you would like to list a registered package that is related to interpolation, please create a Github issue.
90+
91+
7492
## Performance shootout
7593

7694
In the `perf` directory, you can find a script that tests
@@ -136,6 +154,20 @@ they ran more than 20 seconds (far longer than any other test). Both
136154
performed much better in 2d, interestingly. You can see that
137155
Interpolations wins in every case, sometimes by a very large margin.
138156

157+
## Development Status
158+
159+
This package is being maintained but not actively developed. Maintenance is
160+
focused on fixing bugs and issues with the current code base. New features are
161+
welcome via pull requests and will be reviewed and released in a timely fashion.
162+
163+
If you would like to become involved in maintenance or active development of
164+
the package please feel free to get in touch via a Github issue.
165+
166+
This package follows semantic version in that documented features should not
167+
break without changing the minor version.
168+
169+
See the [news](NEWS.md) for details on how to update between breaking releases,
170+
indicated by changes in minor versions.
139171

140172
## Contributing
141173

docs/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
34

45
[compat]
56
Documenter = "0.27"

docs/make.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ sitename="Interpolations.jl",
44
modules=[Interpolations],
55
format=Documenter.HTML(prettyurls = get(ENV, "CI", nothing)=="true"),
66
pages=["Home" => "index.md",
7+
"Convenience Constructors" => "convenience-construction.md",
78
"General usage" => "interpolations.md",
89
"Interpolation algorithms" => "control.md",
910
"Extrapolation" => "extrapolation.md",
10-
"Convenience Constructors" => "convenience-construction.md",
1111
"Knot Iteration" => "iterate.md",
1212
"Developer documentation" => "devdocs.md",
13-
"Library" => "api.md"],
13+
"Library" => "api.md",
14+
"News and Changes" => "NEWS.md",
15+
"Other Interpolation Packages" => "other_packages.md",
16+
],
1417
strict=true,
1518
)
1619

docs/src/convenience-construction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ plot!(legend = :bottomleft)
113113
```
114114

115115
And the generated plot is:
116-
![interpolation plot example](assets/plotsjl_interpolation_example.png)
116+
![interpolation plot example](assets/plotsjl_interpolation_example.png)

docs/src/extrapolation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ etp0 = extrapolate(itp0, Periodic())
3636
etp1 = extrapolate(itp1, Periodic())
3737
etp2 = extrapolate(itp2, Periodic())
3838
etp3 = extrapolate(itp3, Periodic())
39-
```
39+
```

docs/src/index.md

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,46 @@
11

22
# Interpolations
33

4-
[![Build Status](https://travis-ci.org/JuliaMath/Interpolations.jl.svg?branch=master)](https://travis-ci.org/JuliaMath/Interpolations.jl)
5-
[![PkgEval Status](http://pkg.julialang.org/badges/Interpolations_0.4.svg)](http://pkg.julialang.org/?pkg=Interpolations)
6-
[![Interpolations](http://pkg.julialang.org/badges/Interpolations_0.5.svg)](http://pkg.julialang.org/?pkg=Interpolations)
4+
[![version](https://juliahub.com/docs/Interpolations/version.svg)](https://juliahub.com/ui/Packages/Interpolations/VpKVx)
5+
[![pkgeval](https://juliahub.com/docs/Interpolations/pkgeval.svg)](https://juliahub.com/ui/Packages/Interpolations/VpKVx)
6+
[![Build Status](https://github.com/JuliaMath/Interpolations.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/JuliaMath/Interpolations.jl/actions/workflows/CI.yml?query=branch%3Amaster)
7+
[![deps](https://juliahub.com/docs/Interpolations/deps.svg)](https://juliahub.com/ui/Packages/Interpolations/VpKVx?t=2)
8+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](http://juliamath.github.io/Interpolations.jl/stable)
9+
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](http://juliamath.github.io/Interpolations.jl/latest)
710

8-
**NEWS** v0.9 was a breaking release. See the [news](NEWS.md) for details on how to update.
9-
10-
This package implements a variety of interpolation schemes for the
11+
The package [Interpolations.jl](https://github.com/JuliaMath/Interpolations.jl/)
12+
implements a variety of interpolation schemes for the
1113
Julia language. It has the goals of ease-of-use, broad algorithmic
1214
support, and exceptional performance.
1315

14-
Currently this package's support is best
15-
for [B-splines](https://en.wikipedia.org/wiki/B-spline) and also
16-
supports irregular grids. However, the API has been designed with
16+
Currently this package supports
17+
[B-splines](https://en.wikipedia.org/wiki/B-spline) and
18+
irregular grids. The API has been designed with
1719
intent to support more options. Pull-requests are more than welcome!
1820
It should be noted that the API may continue to evolve over time.
1921

20-
Other interpolation packages for Julia include:
21-
- [Dierckx.jl](https://github.com/kbarbary/Dierckx.jl)
22-
- [GridInterpolations.jl](https://github.com/sisl/GridInterpolations.jl)
23-
- [ApproXD.jl](https://github.com/floswald/ApproXD.jl)
22+
There are many other interpolation packages implemented in Julia.
23+
For a listing, see [Other Interpolation Packages](@ref).
2424

2525
Some of these packages support methods that `Interpolations` does not,
2626
so if you can't find what you need here, check one of them or submit a
2727
pull request here.
2828

2929
## Installation
3030

31-
Just
31+
Interpolations.jl can be installed via the following invocation
32+
since it is a registered Julia package.
3233

33-
```
34+
```julia
3435
using Pkg
3536
Pkg.add("Interpolations")
3637
```
3738

38-
from the Julia REPL.
39-
4039
## Example Usage
4140
Create a grid `xs` and an array `A` of values to be interpolated
4241
```julia
4342
xs = 1:0.2:5
44-
f(x) = log(x)
45-
A = [f(x) for x in xs]
43+
A = log.(xs)
4644
```
4745
Create linear interpolation object without extrapolation
4846
```julia
@@ -53,6 +51,61 @@ interp_linear(0.9) # outside grid: error
5351
```
5452
Create linear interpolation object with extrapolation
5553
```julia
56-
interp_linear_extrap = LinearInterpolation(xs, A,extrapolation_bc=Line())
54+
interp_linear_extrap = LinearInterpolation(xs, A, extrapolation_bc=Line())
5755
interp_linear_extrap(0.9) # outside grid: linear extrapolation
5856
```
57+
58+
59+
## Performant Example Usage
60+
61+
The above use of `LinearInterpolation` is actually a short hand for a
62+
composition of `interpolate`, `scale`, and `extrapolate`. You may not need all
63+
of the the scaling and extrapolation features.
64+
65+
```julia
66+
interp_linear = extrapolate(scale(interpolate(A, BSpline(Linear())), xs))
67+
```
68+
69+
If we know we do not need the extrapolation portion, we can use the following.
70+
71+
```julia
72+
scaled_itp = scale(interpolate(A, BSpline(Linear())), xs)
73+
```
74+
75+
We can also remove the scaling for further performance if integer valued knots
76+
and regular grids are sufficient.
77+
78+
```julia
79+
itp = interpolate(A, BSpline(Linear()))
80+
```
81+
82+
Removing the scaling or extrapolation will help accelerate interpolation by
83+
removing unneeded operations and branches. This can permit the use of advanced
84+
processor Single Instruction/Multiple Data (SIMD) capabilities.
85+
86+
## Regular Grids
87+
88+
Interpolations.jl is optimized for use with regular grids with uniform spacing.
89+
The highest performance is achieved when the knots are an `AbstractUnitRange`
90+
such as `2:5` or `Base.OneTo(9)`. The default case if no knots are specified is to
91+
assign the knots as a `UnitRange` starting at `1`.
92+
93+
## Scaling
94+
95+
If the knots are not unit spaced or start at a distinct value other than `1`,
96+
then the `scale` function can be used. While this increases the flexibility of
97+
the interpolation, some performance penalty is acquired.
98+
See [Scaled BSplines](@ref) for further information.
99+
100+
## Irregular Grids
101+
102+
If the knots are irregularly spaced, then the ranges between knots will have to
103+
be scaled as in the `Gridded` interpolation type. See [Gridded interpolation](@ref)
104+
for additional details.
105+
106+
## Points outside the knots
107+
108+
For points not between knots, extrapolation can be used. This introduces a
109+
branch into the code that checks whether the point to be queried is inside or
110+
outside of the knots. This branch can inhibit the use of vectorized SIMD
111+
computation, resulting in a reduction of performance. See [Extrapolation](@ref).

docs/src/other_packages.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Other Interpolation Packages
2+
3+
Other interpolation packages for Julia include:
4+
5+
- [ApproXD.jl](https://github.com/floswald/ApproXD.jl) implements B-spline and linear interpolation in Julia.
6+
- [BarycentricInterpolation.jl](https://github.com/dawbarton/BarycentricInterpolation.jl) implements the Barycentric formula for polynomial interpolation on equispaced points and Chebyshev points of the first and second kind.
7+
- [BasicInterpolators.jl](https://github.com/markmbaum/BasicInterpolators.jl) provides a collection of common interpolation recipes for basic applications.
8+
- [BSplineKit.jl](https://github.com/jipolanco/BSplineKit.jl) offers tools for B-spline based Galerkin and collocation methods, including for interpolation and approximation.
9+
- [Curves.jl](https://github.com/lungben/Curves.jl) supports log-interpolation via immutable `Curve` objects.
10+
- [DataInterpolations.jl](https://github.com/PumasAI/DataInterpolations.jl) is a library for performing interpolations of one-dimensional data.
11+
- [Dierckx.jl](https://github.com/kbarbary/Dierckx.jl) is a wrapper for the dierckx Fortran library, which also underlies `scipy.interpolate`.
12+
- [DIVAnd.jl](https://github.com/gher-ulg/DIVAnd.jl) for N-dimensional smoothing interpolation.
13+
- [FastChebInterp.jl](https://github.com/stevengj/FastChebInterp.jl) does fast multidimensional Chebyshev interpolation on a hypercube using separable grid of interpolation points.
14+
- [FEMBasis.jl](https://github.com/JuliaFEM/FEMBasis.jl) contains interpolation routines for standard finite element function spaces.
15+
- [FineShift.jl](https://github.com/emmt/FineShift.jl) does fast sub-sample shifting of multidimensional arrays.
16+
- [FourierTools.jl](https://github.com/bionanoimaging/FourierTools.jl) includes sinc interpolation for up and down sampling.
17+
- [GridInterpolations.jl](https://github.com/sisl/GridInterpolations.jl) performs multivariate interpolation on a rectilinear grid.
18+
- [InterpolationKernels.jl](https://github.com/emmt/InterpolationKernels.jl) provides a library of interpolation kernels.
19+
- [KissSmoothing.jl](https://github.com/francescoalemanno/KissSmoothing.jl) implements denoising and a Radial Basis Function estimation procedure.
20+
- [LinearInterpolations.jl](https://github.com/jw3126/LinearInterpolations.jl) allows for interpolation using weighted averages allowing probability distributions, rotations, and other Lie groups to be interpolated.
21+
- [LinearInterpolators.jl](https://github.com/emmt/LinearInterpolators.jl) provides linear interpolation methods for Julia based on InterpolationKernels.jl, above.
22+
- [LocalFunctionApproximation.jl](https://github.com/sisl/LocalFunctionApproximation.jl) provides local function approximators that interpolates a scalar-valued function across a vector space.
23+
- [PCHIPInterpolation.jl](https://github.com/gerlero/PCHIPInterpolation.jl) for monotonic interpolation.
24+
- [PiecewiseLinearApprox.jl](https://github.com/RJDennis/PiecewiseLinearApprox.jl) performs piecewise linear interpolation over an arbitrary number of dimensions.
25+
- [ScatteredInterpolation.jl](https://github.com/eljungsk/ScatteredInterpolation.jl) interpolates scattered data in arbitrary dimensions.
26+
27+
Some of these packages support methods that `Interpolations` does not,
28+
so if you can't find what you need here, check one of them or submit a
29+
pull request here.
30+
31+
If you would like to list a registered package that is related to interpolation, please create a Github issue.
32+
33+

0 commit comments

Comments
 (0)