DataTable

class stgraph.utils.DataTable(title: str, col_name_list: list[str])[source]

Bases: object

Table that can display benchmarking data and other info.

This class provides functionality to create and display tables for benchmarking data along with other relevant information.

Example

from stgraph.utils import DataTable

table = DataTable(
    title = "GCN Benchmark Data",
    col_name_list = ["Model", "Time", "MSE"]
)

table.add_row("GCN", 12.56, 45.89)
table.add_row("GCN", 23.34, 44.32)

table.display()
Parameters:
  • title (str) – The title of the table

  • col_name_list (list[str]) – A list of the table column names

title

The title of the table

Type:

str

col_name_list

A list of the table column names

Type:

list[str]

add_row(values: list) None[source]

Add a row of data to the table.

Parameters:

values (list) – A list of values for each column in the row.

display(output_file: IO[str] | None = None) None[source]

Display entire table with data.

Parameters:

output_file (Optional[IO[str]], optional) – File object to write the table to.