Skip to content

Commit 73113c7

Browse files
authored
pretty tables 3 (#1026)
* pretty tables * Fixes for PrettyTables=3 * Don't allow PrettyTables=2 * restrict models for now * cache julia env in benchmark workflow * fix cropping
1 parent e50d40d commit 73113c7

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

.github/workflows/Benchmarking.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
with:
1919
version: '1'
2020

21+
- uses: julia-actions/cache@v2
22+
2123
- name: Install Dependencies
2224
run: julia --project=benchmarks/ -e 'using Pkg; Pkg.instantiate()'
2325

benchmarks/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ DynamicPPL = "0.37"
2626
ForwardDiff = "0.10.38, 1"
2727
LogDensityProblems = "2.1.2"
2828
Mooncake = "0.4"
29-
PrettyTables = "2.4.0"
29+
PrettyTables = "3"
3030
ReverseDiff = "1.15.3"
3131
StableRNGs = "1"

benchmarks/benchmarks.jl

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ using Pkg
22

33
using DynamicPPLBenchmarks: Models, make_suite, model_dimension
44
using BenchmarkTools: @benchmark, median, run
5-
using PrettyTables: PrettyTables, ft_printf
5+
using PrettyTables: pretty_table, fmt__printf
66
using StableRNGs: StableRNG
77

88
rng = StableRNG(23)
@@ -85,18 +85,13 @@ end
8585

8686
table_matrix = hcat(Iterators.map(collect, zip(results_table...))...)
8787
header = [
88-
"Model",
89-
"Dimension",
90-
"AD Backend",
91-
"VarInfo Type",
92-
"Linked",
93-
"Eval Time / Ref Time",
94-
"AD Time / Eval Time",
88+
"Model", "Dim", "AD Backend", "VarInfo", "Linked", "t(eval)/t(ref)", "t(grad)/t(eval)"
9589
]
96-
PrettyTables.pretty_table(
90+
pretty_table(
9791
table_matrix;
98-
header=header,
99-
tf=PrettyTables.tf_markdown,
100-
formatters=ft_printf("%.1f", [6, 7]),
101-
crop=:none, # Always print the whole table, even if it doesn't fit in the terminal.
92+
column_labels=header,
93+
backend=:text,
94+
formatters=[fmt__printf("%.1f", [6, 7])],
95+
fit_table_in_display_horizontally=false,
96+
fit_table_in_display_vertically=false,
10297
)

0 commit comments

Comments
 (0)