compml.report#

PDF report builder for statistical comparison results.

class compml.report.Report(path, title, author, *, subtitle=None, date=None)[source]#

Bases: object

Build a PDF document with the results of the applied statistical tests.

Parameters:
  • path (str | Path) – Output PDF path.

  • title (str) – Document title.

  • author (str) – Author name.

  • subtitle (str | None) – Document subtitle.

  • date (str | None) – Date string.

Examples

>>> report = Report("out.pdf", title="Comparison Report", author="John Doe")
>>> report.add_section_header("Frequentist tests")
>>> report.add_result(some_result)
>>> report.build()
add_result(result, include_plots=False)[source]#

Append a result summary and optionally its associated figure.

Parameters:
  • result (BaseResult) – Result to add to the report.

  • include_plots (bool) – Whether to include the associated figure. Default is False.

Raises:

ValueError – If the result is not a BaseResult or the include_plots is not a boolean.

Return type:

None

add_section_header(text)[source]#

Append a section heading to the report body.

Parameters:

text (str) – Section heading text.

Raises:

ValueError – If the text is not a string.

Return type:

None

build()[source]#

Write the PDF to disk and return the resolved output path.

Returns:

Output path.

Return type:

Path