CSVReporter#

class eclypse.report.reporters.csv.CSVReporter[source]#

Bases: Reporter

Class to report the simulation metrics in CSV format.

It prints an header with the format of the rows and then the values of the reportable.

Methods

__init__(report_path)

Initialize the CSV reporter.

close()

Close all open CSV file handles.

report(event_name, event_idx, callback)

Reports the callback values in a CSV file, one per line.

write(callback_type, data)

Writes the data to a CSV file based on the callback type.

__init__(report_path)[source]#

Initialize the CSV reporter.

Parameters:

report_path (str | Path)

report(event_name, event_idx, callback)[source]#

Reports the callback values in a CSV file, one per line.

Parameters:
  • event_name (str) – The name of the event.

  • event_idx (int) – The index of the event trigger (step).

  • callback (EclypseEvent) – The executed callback containing the data to report.

Return type:

Generator[str, None, None]

async write(callback_type, data)[source]#

Writes the data to a CSV file based on the callback type.

Parameters:
  • callback_type (str) – The type of the callback.

  • data (Any) – The data to write to the CSV file.

async close()[source]#

Close all open CSV file handles.