Approaching PrettyTables v2.0

Hi!

We are approaching PrettyTables.jl v2.0! This version will be tagged when we have everything we need to make PrettyTables.jl the HTML backend in DataFrames (Use PrettyTables.jl as HTML backend by ronisbr ยท Pull Request #3096 ยท JuliaData/DataFrames.jl ยท GitHub). This moment opens a window of opportunity for some breaking changes :smiley: Hence, if anyone has any proposal that can be โ€œeasilyโ€ implemented, please, let me know (we do not have time for significant changes now).

The current code has a lot of internal modifications. We do not have many new features, but the performance is much better. The time to print the first table was reduced from almost 1s to 0.5s (part of the gain is due to Julia 1.8).

We also now support OffsetArrays:

julia> using PrettyTables

julia> using OffsetArrays

julia> A = OffsetArray(rand(3,3), -2:0, -3:-1);

julia> pretty_table(A, show_row_number = true)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Row โ”‚  Col. -3 โ”‚  Col. -2 โ”‚  Col. -1 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  -2 โ”‚ 0.332428 โ”‚ 0.698186 โ”‚ 0.251798 โ”‚
โ”‚  -1 โ”‚ 0.285071 โ”‚ 0.434293 โ”‚ 0.987304 โ”‚
โ”‚   0 โ”‚ 0.515081 โ”‚ 0.756921 โ”‚ 0.397783 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

I would appreciate if someone could test master to check if I miss something!

27 Likes

@fonsp - this is related also to DataFrames.jl+Pluto.jl integration ยท Issue #2206 ยท fonsp/Pluto.jl ยท GitHub as it would be great if we have a solid design for integration of PrettyTables.jl + Pluto.jl (in particular considering DataFrames.jl). Thank you!

6 Likes

my 2 cents : the LateX backend may be improved to sanitize names containing LateX special character like โ€œ_โ€.

1 Like

Hi @LaurentPlagne !

The escaping was already fix in master.

3 Likes

This one would be useful to me

1 Like

Hi @jar1 !

Yeahโ€ฆ I know this would be an awesome feature. However, implement it consistently among all backends will be extremely difficult. I think I will not have the time to finish it for this new version , sorry :frowning:

3 Likes