Skip to content

Commit

Permalink
Fix EmpiricalVarioplane show
Browse files Browse the repository at this point in the history
  • Loading branch information
juliohm committed Oct 9, 2024
1 parent 1488e9b commit 688fcd2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/empirical/varioplane.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
= 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
22 changes: 11 additions & 11 deletions test/empirical.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 688fcd2

Please sign in to comment.