BazerData.jl

Data manipulation utilities for Julia
Log | Files | Refs | README | LICENSE

commit f1b1519c96366d69335ed5229febe6fcd00e1dec
parent 9ed51c4226a195f98d099e72820688716ac64359
Author: Erik Loualiche <[email protected]>
Date:   Sat,  3 Jan 2026 20:12:28 -0600

fix PrettyTables v2 compatibility by replacing hl_col with Highlighter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>

Diffstat:
MProject.toml | 2+-
Msrc/BazerData.jl | 2+-
Msrc/StataUtils.jl | 12++++++------
3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Project.toml b/Project.toml @@ -1,7 +1,7 @@ name = "BazerData" uuid = "d6d9bf1d-14ee-42c9-93f7-cccc2a9ff2c2" authors = ["Erik Loualiche"] -version = "0.7.5" +version = "0.7.6" [deps] ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4" diff --git a/src/BazerData.jl b/src/BazerData.jl @@ -9,7 +9,7 @@ import DataFrames: AbstractDataFrame, ByRow, DataFrame, groupby, combine, nrow, import Dates: format, now, DatePeriod, Dates, Dates.AbstractTime, ISODateTimeFormat import Interpolations: Linear, Constant, Previous, Next, BSpline, interpolate import Missings: disallowmissing -import PrettyTables: Crayon, ft_printf, get, Highlighter, hl_col, pretty_table +import PrettyTables: Crayon, ft_printf, get, Highlighter, pretty_table import Random: seed! import StatsBase: quantile, UnitWeights, Weights # -------------------------------------------------------------------------------------------------- diff --git a/src/StataUtils.jl b/src/StataUtils.jl @@ -159,7 +159,7 @@ function tabulate( # highlighter with gradient for the freq/pct/cum columns (rest is blue) col_highlighters = vcat( - map(i -> (hl_col(i, crayon"cyan bold")), 1:N_COLS), + map(i -> Highlighter((data, row, col) -> col == i, crayon"cyan bold"), 1:N_COLS), hl_custom_gradient(cols=(N_COLS+1), colorscheme=:Oranges_9, scale=maximum(df_out.freq)), hl_custom_gradient(cols=(N_COLS+2), colorscheme=:Greens_9, scale=ceil(Int, maximum(df_out.pct))), hl_custom_gradient(cols=(N_COLS+3), colorscheme=:Greens_9, scale=100), @@ -280,11 +280,11 @@ function tabulate( # total by for the sum col col_highlighters = vcat( - map(i -> (hl_col(i, crayon"cyan bold")), 1:N_GROUP_COLS), - [ hl_custom_gradient(cols=i, colorscheme=:Greens_9, + map(i -> Highlighter((data, row, col) -> col == i, crayon"cyan bold"), 1:N_GROUP_COLS), + [ hl_custom_gradient(cols=i, colorscheme=:Greens_9, scale = ceil(Int, maximum(skipmissing(df_out[1:end-1, i])))) for i in range(1+N_GROUP_COLS; length=N_VAR_COLS) ], - hl_col(size(df_out, 2), crayon"green") + Highlighter((data, row, col) -> col == size(df_out, 2), crayon"green") ) formatters = vcat( @@ -301,8 +301,8 @@ function tabulate( elseif format_stat == :pct col_highlighters = vcat( - map(i -> (hl_col(i, crayon"cyan bold")), 1:N_GROUP_COLS), - [ hl_custom_gradient(cols=i, colorscheme=:Greens_9, + map(i -> Highlighter((data, row, col) -> col == i, crayon"cyan bold"), 1:N_GROUP_COLS), + [ hl_custom_gradient(cols=i, colorscheme=:Greens_9, scale = ceil(Int, maximum(skipmissing(df_out[:, i]))) ) for i in range(1+N_GROUP_COLS; length=N_VAR_COLS) ], )