Skip to content

Commit 9fd5149

Browse files
authored
fix some docstrings and docs issues (#203)
* fix some docstrings and docs issues * Update index.md * Update show.jl * make sure coverage gets processed in travis
1 parent ee15ca5 commit 9fd5149

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language: julia
2+
23
os:
34
- linux
45
- osx
@@ -28,3 +29,12 @@ jobs:
2829
- julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
2930
- julia --project=docs/ docs/make.jl
3031
after_success: skip
32+
33+
after_success:
34+
- |
35+
julia -e '
36+
using Pkg
37+
Pkg.add("Coverage")
38+
using Coverage
39+
Codecov.submit(process_folder())'
40+

docs/src/index.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,13 @@ Fit a polynomial (of degree `deg`) to `x` and `y` using polynomial interpolation
153153
```@example
154154
using Plots, Polynomials
155155
xs = range(0, 10, length=10)
156-
ys = exp.(-xs)
157-
f = fit(xs, ys) # fit(xs, ys, k) for fitting a kth degreee polynomial
156+
ys = @. exp(-xs)
157+
f = fit(xs, ys) # degree = length(xs) - 1
158+
f2 = fit(xs, ys, 2) # degree = 2
158159
159-
scatter(xs, ys, label="Data");
160-
plot!(f, extrema(xs)..., label="Fit");
160+
scatter(xs, ys, markerstrokewidth=0, label="Data")
161+
plot!(f, extrema(xs)..., label="Fit")
162+
plot!(f2, extrema(xs)..., label="Quadratic Fit")
161163
savefig("polyfit.svg"); nothing # hide
162164
```
163165

@@ -193,7 +195,7 @@ julia> convert(ChebyshevT, Polynomial([1.0, 2, 3]))
193195
ChebyshevT(2.5⋅T_0(x) + 2.0⋅T_1(x) + 1.5⋅T_2(x))
194196
```
195197

196-
!!! Note
198+
!!! warning
197199
The older `Poly` type that this package used prior to `v0.7` is implemented as an alternate basis to provide support for older code bases. As of `v1.0`, this type will be only available by executing `using Polynomials.PolyCompat`.
198200

199201
### Iteration

src/common.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ fromroots(A::AbstractMatrix{T}; var::SymbolLike = :x) where {T <: Number} =
6464
fromroots(Polynomial, eigvals(A), var = var)
6565

6666
"""
67-
fit(x, y; [weights], deg=length(x) - 1, var=:x)
68-
fit(::Type{<:AbstractPolynomial}, x, y; [weights], deg=length(x)-1, var=:x)
67+
fit(x, y, deg=length(x) - 1; [weights], var=:x)
68+
fit(::Type{<:AbstractPolynomial}, x, y, deg=length(x)-1; [weights], var=:x)
69+
6970
Fit the given data as a polynomial type with the given degree. Uses linear least squares. When weights are given, as either a `Number`, `Vector` or `Matrix`, will use weighted linear least squares. The default polynomial type is [`Polynomial`](@ref). This will automatically scale your data to the [`domain`](@ref) of the polynomial type using [`mapdomain`](@ref)
7071
"""
7172
function fit(P::Type{<:AbstractPolynomial},

src/pade.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ Evaluate the Pade approximant at the given point.
9191
```jldoctest pade
9292
julia> using SpecialFunctions, Polynomials
9393
94+
9495
julia> p = Polynomial(@.(1 // BigInt(gamma(1:17))));
9596
9697
9798
julia> pade = Pade(p, 8, 8);
9899
99-
100100
julia> pade(1.0) ≈ exp(1.0)
101101
true
102102

0 commit comments

Comments
 (0)