Skip to content

ODS Gen

Created on Dec 2, 2025

@author: Tom Schmidt

DataValidation

Helper class representing a spreadsheet data validation.

__eq__(other: object) -> bool

Equality operator.

Attributes:

Name Type Description
other object

Other DataValidation object.

__hash__() -> int

Hash function.

__init__(params: dict[str, Any] = {}, default: Any = None, color: Optional[str] = None)

Initialize DataValidation.

Attributes:

Name Type Description
params dict[str, Any]

Data validation parameters.

default Any

Default value.

color Optional[str]

Color reference.

write(xlsxdoc: XLSXDoc, sheet: Worksheet, row: int, col: int) -> None

Write to XLSX document sheet.

Attributes:

Name Type Description
xlsxdoc XLSXDoc

XLSX document.

sheet Worksheet

XLSX worksheet.

row int

Row index.

col int

Column index.

Formula

Helper class representing a spreadsheet formula.

__init__(formula_string: str)

Initialize Formula.

Attributes:

Name Type Description
formula_string str

Formula string.

__str__() -> str

Get spreadsheet string representation.

Sheet

Class representing an XLSX sheet.

__init__(benchmark: result.BenchmarkMerge, measures: dict[str, Any], name: str, ref_sheet: Optional[Sheet] = None, sheet_type: str = 'instance')

Initialize sheet.

Attributes:

Name Type Description
benchmark BenchmarkMerge

Benchmark.

measures dict[str, Any]

Measures to be displayed.

name str

Name of the sheet.

refSheet Optional[Sheet]

Reference sheet.

sheet_type str

Type of the sheet.

add_benchclass_summary(block: SystemBlock, benchclass_result: result.ClassResult, benchclass_summary: dict[str, Any]) -> None

Add benchmark class summary to SystemBlock.

Attributes:

Name Type Description
block SystemBlock

SystemBlock to which summary is added.

benchclass_result ClassResult

ClassResult.

benchclass_summary dict[str, Any]

Summary of benchmark class.

add_col_summary() -> None

Add column summary if applicable to column type.

add_instance_results(block: SystemBlock, instance_result: result.InstanceResult, benchclass_summary: dict[str, Any], instance_summary: dict[result.InstanceResult, dict[str, Any]]) -> None

Add instance results to SystemBlock and add values to summary if necessary.

Attributes:

Name Type Description
block SystemBlock

SystemBlock to which results are added.

instance_result InstanceResult

InstanceResult.

benchclass_summary dict[str, Any]

Summary of benchmark class.

instance_summary dict[InstanceResult, dict[str, Any]]

Summary of instance results.

add_merged_instance_results(block: SystemBlock, instance_result: result.InstanceResult, instance_summary: dict[result.InstanceResult, dict[str, Any]]) -> None

Add merged instance results to SystemBlock and add values to summary if necessary.

Attributes:

Name Type Description
block SystemBlock

SystemBlock to which results are added.

instance_result InstanceResult

InstanceResult.

instance_summary dict[InstanceResult, dict[str, Any]]

Summary of benchmark class.

add_row_summary(offset: int) -> None

Add row summary (min, max, median).

Attributes:

Name Type Description
offset int

Column offset.

add_runspec(runspec: result.Runspec) -> None

Add results to their respective blocks.

Attributes:

Name Type Description
runspec Runspec

Run specification

add_styles() -> None

Color float results and their summaries. Get column formats.

export_values(file_name: str, metadata: dict[str, list[Any]]) -> None

Export values to parquet file.

Attributes:

Name Type Description
file_name str

Name of the parquet file.

finish() -> None

Finish XLSX content.

write_sheet(xlsxdoc: XLSXDoc) -> None

Write sheet to XLSX document.

Attributes:

Name Type Description
xlsxdoc XLSXDoc

XLSX document.

SystemBlock dataclass

Dataframe containing results for system.

Attributes:

Name Type Description
setting Optional[Setting]

Benchmark setting.

machine Optional[Machine]

Machine.

content DataFrame

Results.

columns dict[str, Any]

Dictionary of columns and their types.

offset Optional[int]

Offset for final block position.

add_cell(row: int, name: str, value_type: str, value: Any) -> None

Add cell to dataframe.

Attributes:

Name Type Description
row int

Row of the new cell.

name str

Name of the column of the new cell (in most cases the measure).

valueType str

Data type of the new cell.

value Any

Value of the new cell.

gen_name(add_machine: bool) -> str

Generate name of the block.

Attributes:

Name Type Description
addMachine bool

Whether to include the machine name in the name.

XLSXDoc

Class representing XLSX document.

__init__(benchmark: result.BenchmarkMerge, measures: dict[str, Any], max_col_width: int = 300)

Setup Instance and Class sheet.

Attributes:

Name Type Description
benchmark BenchmarkMerge

BenchmarkMerge object.

measures dict[str, Any]

Measures to be displayed.

add_runspec(runspec: result.Runspec) -> None

Attributes:

Name Type Description
runspec Runspec

Run specification.

finish() -> None

Complete sheets by adding formulas and summaries.

make_xlsx(out: str) -> None

Write XLSX file.

Attributes:

Name Type Description
out str

Name of the generated XLSX file.

get_cell_index(col: int, row: int, abs_col: bool = False, abs_row: bool = False) -> str

Calculate spreadsheet cell index.

Attributes:

Name Type Description
col int

Column index.

row int

Row index.

abs_col bool

Set '$' for column.

abs_row bool

Set '$' for row.

try_float(v: Any) -> Any

Try to cast given value to float. Return input if not possible.

Attributes:

Name Type Description
v Any

Value tried to be cast to float.