diff --git a/Project.toml b/Project.toml index f37eb3c4..5055318a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ManifoldsBase" uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb" authors = ["Seth Axen ", "Mateusz Baran ", "Ronny Bergmann ", "Antoine Levitt "] -version = "0.14.7" +version = "0.14.8" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/bases.jl b/src/bases.jl index 139d960b..3d41edc3 100644 --- a/src/bases.jl +++ b/src/bases.jl @@ -1010,18 +1010,23 @@ function show( ::MIME"text/plain", B::CachedBasis{𝔽,T,D}, ) where {𝔽,T<:AbstractBasis,D} - vectors = _get_vectors(B) - print( - io, - "Cached basis of type $T with $(length(vectors)) basis vector$(length(vectors) == 1 ? "" : "s"):", - ) - return _show_basis_vector_range_noheader( - io, - vectors; - max_vectors = 4, - pre = " ", - sym = " E", - ) + try + vectors = _get_vectors(B) + print( + io, + "Cached basis of type $T with $(length(vectors)) basis vector$(length(vectors) == 1 ? "" : "s"):", + ) + return _show_basis_vector_range_noheader( + io, + vectors; + max_vectors = 4, + pre = " ", + sym = " E", + ) + catch e + # in case _get_vectors(B) is not defined + print(io, "Cached basis of type $T") + end end function show( io::IO, diff --git a/test/bases.jl b/test/bases.jl index 1674adb4..ad5e64ec 100644 --- a/test/bases.jl +++ b/test/bases.jl @@ -255,6 +255,12 @@ DiagonalizingBasisProxy() = DiagonalizingOrthonormalBasis([1.0, 0.0, 0.0]) M = DefaultManifold(3) + @test sprint( + show, + "text/plain", + CachedBasis(NonBasis(), NonBroadcastBasisThing([])), + ) == "Cached basis of type NonBasis" + @testset "Constructors" begin @test DefaultBasis{ℂ,TangentSpaceType}() === DefaultBasis(ℂ) @test DefaultOrthogonalBasis{ℂ,TangentSpaceType}() === DefaultOrthogonalBasis(ℂ)