clarity.utils.results_support module

Dataclass to save challenges results to a CSV file.

class clarity.utils.results_support.ResultsFile(file_name: str | Path, header_columns: list[str], append_results: bool = False)[source]

Bases: object

A utility class for writing results to a CSV file.

file_name

The name of the file to write results to.

Type:

str | Path

header_columns

The columns to write to the CSV file.

Type:

list[str]

append_results

Whether to append results to an existing file. If False, a new file will be created and the header row will be written. Defaults to False.

Type:

bool

add_result(row_values: dict[str, str | float])[source]

Add a result to the CSV file.

Parameters:

row_values (dict[str, str | float]) – The values to write to the CSV file.

append_results: bool = False
file_name: str | Path
header_columns: list[str]