Skip to content

Commit 43a5cb4

Browse files
authored
Fix printing of slices of OrthogonalPolynomial (#180)
* Possible fix * Be less specific
1 parent 3a9ea5f commit 43a5cb4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/ClassicalOrthogonalPolynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ abstract type AbstractOPLayout <: AbstractBasisLayout end
7171
struct OPLayout <: AbstractOPLayout end
7272
MemoryLayout(::Type{<:OrthogonalPolynomial}) = OPLayout()
7373

74-
74+
Base.isassigned(P::OrthogonalPolynomial, x, n) = (x axes(P,1)) && (n axes(P,2))
7575

7676
sublayout(::AbstractOPLayout, ::Type{<:Tuple{<:AbstractAffineQuasiVector,<:Slice}}) = MappedOPLayout()
7777

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,8 @@ end
7979
@test_throws ErrorException jacobimatrix(MyIncompleteJacobi())
8080
@test_throws ErrorException plan_transform(MyIncompleteJacobi(), 5)
8181
end
82+
83+
@testset "Issue #179" begin
84+
@test startswith(sprint(show, MIME"text/plain"(), Chebyshev()[0.3, :]; context=(:compact=>true, :limit=>true)), "ℵ₀-element view(::ChebyshevT{Float64}, 0.3, :)")
85+
@test startswith(sprint(show, MIME"text/plain"(), Jacobi(0.2, 0.5)[-0.7, :]; context=(:compact=>true, :limit=>true)), "ℵ₀-element view(::Jacobi{Float64}, -0.7, :)")
86+
end

0 commit comments

Comments
 (0)