Skip to content

Commit

Permalink
Merge 4c643a4 into de79731
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran authored Jul 7, 2023
2 parents de79731 + 4c643a4 commit 06516c4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ManifoldsBase"
uuid = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
authors = ["Seth Axen <seth.axen@gmail.com>", "Mateusz Baran <mateuszbaran89@gmail.com>", "Ronny Bergmann <manopt@ronnybergmann.net>", "Antoine Levitt <antoine.levitt@gmail.com>"]
version = "0.14.7"
version = "0.14.8"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
29 changes: 17 additions & 12 deletions src/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions test/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(ℂ)
Expand Down

0 comments on commit 06516c4

Please sign in to comment.