From 688fcd2740cedbb4eae4e7a94d60052cb9025c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20Hoffimann?= Date: Wed, 9 Oct 2024 10:57:24 -0300 Subject: [PATCH] Fix EmpiricalVarioplane show --- src/empirical/varioplane.jl | 6 +++--- test/empirical.jl | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/empirical/varioplane.jl b/src/empirical/varioplane.jl index 91cd9fe..1f25ce1 100644 --- a/src/empirical/varioplane.jl +++ b/src/empirical/varioplane.jl @@ -71,10 +71,10 @@ end function Base.show(io::IO, ::MIME"text/plain", γ::EmpiricalVarioplane) θs = [@sprintf "%.2f" rad2deg(θ) for θ in γ.θs] - ns = [sum(values(g)[3]) for g in γ.γs] - lines = [" └─$(θ)° → $n" for (θ, n) in zip(θs, ns)] + nθ = length(θs) + lines = [" └─$(θ)°" for θ in θs] lines = length(lines) > 11 ? vcat(lines[1:5], [" ⋮"], lines[(end - 4):end]) : lines println(io, γ) - println(io, " N° pairs") + println(io, " $nθ angles") print(io, join(lines, "\n")) end diff --git a/test/empirical.jl b/test/empirical.jl index bc5ca92..0334fba 100644 --- a/test/empirical.jl +++ b/test/empirical.jl @@ -102,18 +102,18 @@ @test sprint(show, γ) == "EmpiricalVarioplane" @test sprint(show, MIME"text/plain"(), γ) == """ EmpiricalVarioplane - N° pairs - └─0.00° → 372500 - └─3.67° → 304782 - └─7.35° → 298306 - └─11.02° → 297432 - └─14.69° → 297243 + 50 angles + └─0.00° + └─3.67° + └─7.35° + └─11.02° + └─14.69° ⋮ - └─165.31° → 293643 - └─168.98° → 295850 - └─172.65° → 296931 - └─176.33° → 306528 - └─180.00° → 372500""" + └─165.31° + └─168.98° + └─172.65° + └─176.33° + └─180.00°""" end @testset "Directional" begin