Skip to content

Don't print docstrings explicitly to avoid breakages #507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunBase"
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
version = "0.8.43"
version = "0.8.44"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
31 changes: 18 additions & 13 deletions src/Fun.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,13 @@ Return the domain that `f` is defined on.
```jldoctest
julia> f = Fun(x->x^2);

julia> domain(f)
-1.0..1.0 (Chebyshev)
julia> domain(f) == ChebyshevInterval()
true

julia> f = Fun(x->x^2, 0..1);

julia> domain(f)
0..1
julia> domain(f) == 0..1
true
```
"""
domain(f::Fun) = domain(f.space)
Expand All @@ -293,14 +293,21 @@ Return `f` projected onto `domain`.

# Examples
```jldoctest
julia> f = Fun(x->x^2)
Fun(Chebyshev(), [0.5, 0.0, 0.5])
julia> f = Fun(x->x^2);

julia> domain(f) == ChebyshevInterval()
true

julia> setdomain(f, 0..1)
Fun(Chebyshev(0..1), [0.5, 0.0, 0.5])
julia> g = setdomain(f, 0..1);

julia> domain(g) == 0..1
true

julia> coefficients(f) == coefficients(g)
true
```
"""
setdomain(f::Fun,d::Domain) = Fun(setdomain(space(f),d),f.coefficients)
setdomain(f::Fun, d::Domain) = Fun(setdomain(space(f), d), f.coefficients)

for op in (:tocanonical,:tocanonicalD,:fromcanonical,:fromcanonicalD,:invfromcanonicalD)
@eval $op(f::Fun,x...) = $op(space(f),x...)
Expand Down Expand Up @@ -385,10 +392,7 @@ Return an extrapolation of `f` from its domain to `x`.
julia> f = Fun(x->x^2)
Fun(Chebyshev(), [0.5, 0.0, 0.5])

julia> domain(f)
-1.0..1.0 (Chebyshev)

julia> extrapolate(f, 2)
julia> extrapolate(f, 2) # 2 lies outside the domain -1..1
4.0
```
"""
Expand Down Expand Up @@ -422,6 +426,7 @@ values(f::Fun,dat...) = _values(f.space, f.coefficients, dat...)
_values(sp, v, dat...) = itransform(sp, v, dat...)
_values(sp::UnivariateSpace, v::Vector{T}, dat...) where {T<:Number} =
itransform(sp, v, dat...)::Vector{float(T)}

"""
points(f::Fun)

Expand Down
4 changes: 2 additions & 2 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
@testset "Operator" begin
@testset "QuotientSpace" begin
Q = QuotientSpace(Dirichlet(ConstantSpace(0..1)))
@test startswith(repr(Q), "ConstantSpace(0..1) /")
@test startswith(repr(Q), "ConstantSpace($(0..1)) /")
show(io, MIME"text/plain"(), Q)
s = String(take!(io))
@test startswith(s, "ConstantSpace(0..1) /")
@test startswith(s, "ConstantSpace($(0..1)) /")
end
@testset "ConstantOperator" begin
A = I : PointSpace(1:4)
Expand Down