Skip to content

Commit

Permalink
Doctests and documentation patch (#571)
Browse files Browse the repository at this point in the history
* Add lowest_terms doc for site

Polynomials.RationalFunction makes a reference to lowest_terms

* Add more doctests and syntax highlighting tags

* Fix latex syntax in docstrings

* Remove names from doctest blocks

The named doctest blocks don't share scope and don't need to have the same environment

* Fix spacing

* Use markdown lists in docstrings

* Fix more spacing

* Use identity check for nothing-ness

* Pull list text into list
  • Loading branch information
abhro authored Jun 7, 2024
1 parent a285740 commit 8b8055d
Show file tree
Hide file tree
Showing 19 changed files with 276 additions and 287 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
GR_jll = "d2c73de3-f751-5644-a686-071e5b155ba9"
GenericLinearAlgebra = "14197337-ba66-59df-a3e3-ca00e7dcff7a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"

Expand Down
28 changes: 14 additions & 14 deletions docs/src/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,24 +283,24 @@ We need to add in the vector-space operations:

```jldoctest new_container_type
julia> function Base.:+(p::AliasPolynomialType{B,T,X}, q::AliasPolynomialType{B,S,X}) where {B,S,T,X}
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] + q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs) # save a copy
end
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] + q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs) # save a copy
end
julia> function Base.:-(p::AliasPolynomialType{B,T,X}, q::AliasPolynomialType{B,S,X}) where {B,S,T,X}
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] - q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs)
end
R = promote_type(T,S)
n = maximum(degree, (p,q))
cs = [p[i] - q[i] for i in 0:n]
AliasPolynomialType{B,R,X}(Val(false), cs)
end
julia> function Base.map(fn, p::P) where {B,T,X,P<:AliasPolynomialType{B,T,X}}
cs = map(fn, p.coeffs)
R = eltype(cs)
AliasPolynomialType{B,R,X}(Val(false), cs)
end
cs = map(fn, p.coeffs)
R = eltype(cs)
AliasPolynomialType{B,R,X}(Val(false), cs)
end
```

Expand Down
Loading

0 comments on commit 8b8055d

Please sign in to comment.