Skip to content

Commit

Permalink
Revert "test: PrettyTables "v3""
Browse files Browse the repository at this point in the history
This reverts commit e49c3ef.
  • Loading branch information
mgyoo86 committed Oct 22, 2024
1 parent e49c3ef commit e4c4973
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 117 deletions.
5 changes: 0 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ ONNXRunTime = "e034b28e-924e-41b2-b98f-d2bbeb830c6a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
StyledStrings = "f489334b-da3d-4c2e-b8f0-e476e12c162b"

[sources]
PrettyTables = {rev = "v3", url = "https://github.com/ronisbr/PrettyTables.jl"}

[compat]
BSplineKit = "0.17.6"
Expand All @@ -24,7 +20,6 @@ ONNXRunTime = "1.2.0"
Plots = "1.40.8"
PrettyTables = "2.4.0"
Printf = "1.11.0"
StyledStrings = "1.11.0"
julia = "1.11.1"

[extras]
Expand Down
110 changes: 0 additions & 110 deletions src/TroyonBetaNN.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using BSplineKit
using Printf
using Plots
using PrettyTables
using StyledStrings

import ONNXRunTime as ORT

Expand Down Expand Up @@ -696,113 +695,4 @@ function plot_sample_points(TD::Troyon_Data, eqt::IMAS.equilibrium__time_slice;
display(fig)
end

function test_pretty_table()

# == Creating the Table ====================================================================

v1_t = 0:5:20

v1_a = ones(length(v1_t)) * 1.0

v1_v = @. 0 + v1_a * v1_t

v1_d = @. 0 + v1_a * v1_t^2 / 2

v2_t = 0:5:20

v2_a = ones(length(v2_t)) * 0.75

v2_v = @. 0 + v2_a * v2_t

v2_d = @. 0 + v2_a * v2_t^2 / 2

table = [
v1_t v1_a v1_v v1_d
v2_t v2_a v2_v v2_d
];

# == Configuring the Table =================================================================

title = "Table 1. Data obtained from the test procedure."

subtitle = "Comparison between two vehicles"

column_labels = [
[EmptyCells(2), MultiColumn(2, "Estimated Data")],
["Time (s)", "Acceleration", "Velocity", "Position"],
]

units = [
styled"{(foreground=gray):[s]}",
styled"{(foreground=gray):[m / s²]}",
styled"{(foreground=gray):[m / s]}",
styled"{(foreground=gray):[m]}",
]

push!(column_labels, units)

merge_column_label_cells = :auto

row_group_labels = [
1 => "Vehicle #1",
6 => "Vehicle #2"
]

summary_rows = [
(data, j) -> maximum(@views data[ 1:5, j]),
(data, j) -> maximum(@views data[6:10, j]),
]

summary_row_labels = [
"Max. for Vehicle #1",
"Max. for Vehicle #2",
]

footnotes = [
(:column_label, 1, 3) => "Estimated data based on the acceleration measurement."
]

highlighters = [
TextHighlighter((data, i, j) -> (j == 3) && (data[i, j] > 10), crayon"fg:red bold")
TextHighlighter((data, i, j) -> (j == 4) && (data[i, j] > 10), crayon"fg:blue bold")
]

tf = TextTableFormat(
# Remove vertical lines.
right_vertical_lines_at_data_columns = :none,
vertical_line_after_data_columns = false,
vertical_line_after_row_label_column = false,
vertical_line_at_beginning = false,
)

style = TextTableStyle(
column_label = crayon"bold",
first_line_merged_column_label = crayon"fg:yellow bold underline",
footnote = crayon"fg:cyan",
row_group_label = crayon"fg:magenta bold",
subtitle = crayon"italics",
title = crayon"fg:yellow bold",
)

# == Printing the Table ====================================================================

pretty_table(
table;
column_labels,
footnotes,
highlighters,
merge_column_label_cells,
row_group_labels,
style,
subtitle,
summary_row_labels,
summary_rows,
tf,
title,
)


end


end # module TroyonBetaNN
2 changes: 0 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ using IMAS

@testset "TroyonBetaNN.jl" begin

TBNN.test_pretty_table()

file_path = joinpath(@__DIR__, "data", "dd_D3D.json")
dd = IMAS.json2imas(file_path);
TD_vec = TBNN.Calculate_Troyon_beta_limits_for_IMAS_dd(dd; verbose=true);
Expand Down

0 comments on commit e4c4973

Please sign in to comment.