Skip to content

Commit aebbb6d

Browse files
committed
foo
1 parent 1b9b6a3 commit aebbb6d

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ MacroTools = "0.5"
3737
OrderedCollections = "1"
3838
Parameters = "0.12"
3939
Plots = "1"
40-
PrettyTables = "3"
40+
PrettyTables = "2"
4141
RecipesBase = "1"
4242
julia = "1.10"

src/print.jl

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -249,18 +249,33 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::Model)
249249
__is_objective_set(ocp) ? "V" : "X",
250250
)
251251
println("")
252-
h1 = TextHighlighter((data, i, j) -> data[i, j] == "X", crayon"bold red")
253-
h2 = TextHighlighter((data, i, j) -> data[i, j] == "V", crayon"bold green")
254-
style = TextTableStyle(first_line_column_label = crayon"yellow bold")
252+
#### PrettyTables v2
253+
h1 = Highlighter((data, i, j) -> data[i, j] == "X"; bold=true, foreground=:red)
254+
h2 = Highlighter((data, i, j) -> data[i, j] == "V"; bold=true, foreground=:green)
255255
pretty_table(
256256
io,
257257
data;
258-
column_labels=header,
259-
style= style,
260-
highlighters=[h1, h2],
258+
tf=tf_unicode_rounded,
259+
header=header,
260+
header_crayon=crayon"yellow",
261+
crop=:none,
262+
highlighters=(h1, h2),
261263
alignment=:c,
262264
compact_printing=true,
263265
)
266+
#### PrettyTables v3
267+
# h1 = TextHighlighter((data, i, j) -> data[i, j] == "X", crayon"bold red")
268+
# h2 = TextHighlighter((data, i, j) -> data[i, j] == "V", crayon"bold green")
269+
# style = TextTableStyle(first_line_column_label = crayon"yellow bold")
270+
# pretty_table(
271+
# io,
272+
# data;
273+
# column_labels=header,
274+
# style= style,
275+
# highlighters=[h1, h2],
276+
# alignment=:c,
277+
# compact_printing=true,
278+
# )
264279

265280
#
266281
return nothing
@@ -536,18 +551,33 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::PreModel)
536551
__is_objective_set(ocp) ? "V" : "X",
537552
)
538553
println("")
539-
h1 = TextHighlighter((data, i, j) -> data[i, j] == "X", crayon"bold red")
540-
h2 = TextHighlighter((data, i, j) -> data[i, j] == "V", crayon"bold green")
541-
style = TextTableStyle(first_line_column_label = crayon"yellow bold")
554+
#### PrettyTables v2
555+
h1 = Highlighter((data, i, j) -> data[i, j] == "X"; bold=true, foreground=:red)
556+
h2 = Highlighter((data, i, j) -> data[i, j] == "V"; bold=true, foreground=:green)
542557
pretty_table(
543558
io,
544559
data;
545-
column_labels=header,
546-
style= style,
547-
highlighters=[h1, h2],
560+
tf=tf_unicode_rounded,
561+
header=header,
562+
header_crayon=crayon"yellow",
563+
crop=:none,
564+
highlighters=(h1, h2),
548565
alignment=:c,
549566
compact_printing=true,
550567
)
568+
#### PrettyTables v3
569+
# h1 = TextHighlighter((data, i, j) -> data[i, j] == "X", crayon"bold red")
570+
# h2 = TextHighlighter((data, i, j) -> data[i, j] == "V", crayon"bold green")
571+
# style = TextTableStyle(first_line_column_label = crayon"yellow bold")
572+
# pretty_table(
573+
# io,
574+
# data;
575+
# column_labels=header,
576+
# style= style,
577+
# highlighters=[h1, h2],
578+
# alignment=:c,
579+
# compact_printing=true,
580+
# )
551581

552582
#
553583
return nothing

0 commit comments

Comments
 (0)