Skip to content

report.experiment_report

Create report of simulation experiments.

ReportResults

ReportResults()

Results for a ExperimentReport.

Construct ReportResults.

to_json

to_json(json_path)

Write to JSON.

Parameters:

Name Type Description Default
json_path Path

Path to the JSON file.

required

from_json staticmethod

from_json(json_path)

Read from JSON.

Parameters:

Name Type Description Default
json_path Path

Path to the JSON file.

required

Returns:

Type Description
ReportResults

ReportResults read from the file.

add_experiment_result

add_experiment_result(exp_result)

Retrieve information for report from the ExperimentResult.

Parameters:

Name Type Description Default
exp_result ExperimentResult

Result of the simulation experiment.

required

Raises:

Type Description
ValueError

If a model has no resolvable path.

ExperimentReport

ExperimentReport(
    results, metadata=None, template_path=TEMPLATE_PATH
)

Report for an experiment.

Construct an ExperimentReport.

Parameters:

Name Type Description Default
results ReportResults | list[ExperimentResult]

Report results or list of experiment results.

required
metadata dict[str, Any] | None

Additional metadata for the report.

None
template_path Path

Directory with the jinja2 templates.

TEMPLATE_PATH

ReportType

Bases: Enum

Type of report.

create_report

create_report(
    output_path,
    filename=None,
    report_type=HTML,
    f_filter_context=None,
    **kwargs,
)

Create report of SimulationExperiments.

Processes ExperimentResults to generate overall report.

All relative paths only can be resolved in the report if the paths are below the report or at the same level in the file hierarchy.

Parameters:

Name Type Description Default
output_path Path

Directory for the report.

required
filename str | None

Name of the index file (without suffix).

None
report_type ReportType

Type of the report.

HTML
f_filter_context Callable[[dict[str, Any]], None] | None

Function filtering the context (latex reports).

None
**kwargs Any

Additional arguments, e.g. latex_path_prefix.

{}

Returns:

Type Description
Path

Path to the created index file.

Raises:

Type Description
ValueError

If the report type is not supported.