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!

@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!

my 2 cents : the LateX backend may be improved to sanitize names containing LateX special character like “_”.

Hi @LaurentPlagne !

The escaping was already fix in master.

This one would be useful to me

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: