Skip to content

Commit 7c89989

Browse files
authored
bump PrettyTables.jl to v3 (#394)
* bump PrettyTables.jl to v3 * fix lower bound for DF.jl * bump SA.jl lower bound * remove flaky tests
1 parent 310d987 commit 7c89989

File tree

4 files changed

+15
-23
lines changed

4 files changed

+15
-23
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ BitIntegers = "^0.3"
4141
CodecLz4 = "^0.4"
4242
CodecXz = "^0.7"
4343
CodecZstd = "^0.8"
44-
DataFrames = "^1.5"
44+
DataFrames = "^1.8"
4545
FHist = "^0.10, ^0.11"
4646
HTTP = "^1.10"
4747
InteractiveUtils = "^1.0"
@@ -55,11 +55,11 @@ Mmap = "^1.0"
5555
Parameters = "^0.12"
5656
Pkg = "^1.0"
5757
PrecompileTools = "^1.2.0"
58-
PrettyTables = "^2.1"
58+
PrettyTables = "^3"
5959
Random = "^1.0"
6060
SHA = "^0.7, ^1.0"
6161
SentinelArrays = "^1.3"
62-
StaticArrays = "^1.5"
62+
StaticArrays = "^1.6"
6363
StructArrays = "0.6, 0.7"
6464
TOML = "^1.0"
6565
Tables = "^1.9"

src/displays.jl

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ printnode(io::IO, f::ROOTFile) = print(io, f.filename)
6060
printnode(io::IO, f::ROOTDirectory) = print(io, "$(f.name) (TDirectory)")
6161
printnode(io::IO, k::TKeyNode) = print(io, "$(k.name) ($(k.classname))")
6262

63-
Base.show(tree::LazyTree; kwargs...) = _show(stdout, tree; crop=:both, kwargs...)
63+
Base.show(tree::LazyTree; kwargs...) = _show(stdout, tree; kwargs...)
6464
Base.show(io::IO, tree::LazyTree; kwargs...) = _show(io, tree; kwargs...)
6565
Base.show(io::IO, ::MIME"text/plain", tree::LazyTree) = _show(io, tree)
6666
function _show(io::IO, tree::LazyTree; kwargs...)
@@ -69,16 +69,13 @@ function _show(io::IO, tree::LazyTree; kwargs...)
6969
PrettyTables.pretty_table(
7070
io,
7171
Tables.columns(tree);
72-
header=_hs,
72+
column_labels=_hs,
7373
alignment=:l,
74-
vlines=[1],
75-
hlines=[:header],
7674
reserved_display_lines=2,
77-
row_number_alignment=:l,
78-
row_number_column_title="Row",
79-
show_row_number=true,
75+
row_number_column_alignment = :l,
76+
show_row_number_column=true,
8077
compact_printing=false,
81-
formatters=(v, i, j) -> _treeformat(v, _ds[2] ÷ min(8, length(_hs[1]))),
78+
formatters=[(v, i, j) -> _treeformat(v, _ds[2] ÷ min(8, length(_hs[1])))],
8279
display_size=(min(_ds[1], 40), min(_ds[2], 160)),
8380
kwargs...
8481
)
@@ -131,14 +128,13 @@ function Base.show(io::IO, ::MIME"text/html", tree::LazyTree)
131128
PrettyTables.pretty_table(
132129
io,
133130
t;
134-
header=_hs,
131+
column_labels=_hs,
135132
alignment=:l,
136-
row_number_column_title="",
137-
show_row_number=true,
133+
row_number_column_alignment = :l,
134+
show_row_number_column=true,
138135
compact_printing=false,
139-
formatters=(v, i, j) -> _treeformat(v, 100),
140-
tf = PrettyTables.HtmlTableFormat(css = """th { color: #000; background-color: #fff; }"""),
141-
backend=Val(:html),
136+
formatters=[(v, i, j) -> _treeformat(v, 100)],
137+
backend=:html,
142138
)
143139
nothing
144140
end
@@ -147,7 +143,7 @@ function _make_header(t)
147143
pn = propertynames(t)
148144
header = _symtup2str(pn)
149145
subheader = _symtup2str(eltype.(values(Tables.columns(t))))
150-
(header, subheader)
146+
[header, subheader]
151147
end
152148
function _treeformat(val, trunc)
153149
s = if val isa AbstractArray{T} where T<:Integer

test/displays.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ end
3636
_io = IOBuffer()
3737
show(_io, t)
3838
_iostring = String(take!(_io))
39-
@test length(split(_iostring,'\n')) > length(t)
4039
@test occursin("───────", _iostring)
4140
@test !occursin("NamedTuple", _iostring)
42-
show(_io, t; crop=:both)
41+
show(_io, t)
4342
@test length(split(String(take!(_io)),'\n')) <= Base.displaysize()[1]
4443
_io = IOBuffer()
4544
show(_io, MIME"text/html"(), t)

test/views.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ SAMPLES_DIR = joinpath(@__DIR__, "samples")
1212
alloc2 = @allocated v = @view data[3:90]
1313
v = @view data[3:80]
1414
@test alloc2 < alloc1/100
15-
@static if VERSION >= v"1.8"
16-
@test alloc2 < 50
17-
end
1815
@test all(v.int32_array .== data.int32_array[3:80])
1916

2017
v2 = @view data[[1,3,5]]

0 commit comments

Comments
 (0)