genipe.reporting package

Module contents


genipe.reporting.autoreport module

genipe.reporting.autoreport.generate_report(out_dir, run_opts, run_info)[source]

Generate the report.

  • out_dir (str) – the output directory for the report
  • run_opts (dict) – the run options
  • run_info (dict) – the run information

genipe.reporting.utils module


Configure the jinja2 environment for LaTeX.


The configuration used is for LaTeX documents. Hence, a block command is done using \BLOCK{} and variables using \VAR{} in the Jinja2 template.


Sanitize TeX text.

Parameters:original_text (str) – the text to sanitize for LaTeX

Text is sanitized by following these steps:

  1. Replaces \\ by \textbackslash
  2. Escapes certain characters (such as $, %, _, }, {, & and #) by adding a backslash (e.g. from & to \&).
  3. Replaces special characters such as ~ by the LaTeX equivalent (e.g. from ~ to $\sim$).
genipe.reporting.utils.format_tex(text, tex_format)[source]

Change the TeX text format.

  • text (str) – the text for which the format needs to be specified
  • tex_format (str) – the format of the text to return

the formatted text

Return type:


This will change the format by adding the LaTeX format command (e.g. from text to \texttt{text}).


Only the following format are available:

  • texttt
  • emph
  • textbf
  • textit

Wraps the text.

Parameters:original_text (str) – the text to wrap
Returns:a string where the original text was wrapped
Return type:str

Wraps the text so that lines are no longer than 80 characters. Uses the str.join() function on the results of the wrap() function, so that a single string is returned.

genipe.reporting.utils.create_tabular(template, header, data, header_multicol=None, col_align=None)[source]

Creates a TeX tabular.

  • template (jinja2.Template) – the tabular template
  • header (list) – the header of the tabular
  • data (list) – the tabular data
  • header_multicol (list) – the number of columns for the header
  • col_align (list) – the column alignement

a string representation of a LaTeX tabular

Return type:


genipe.reporting.utils.create_float(template, float_type, caption, label, content, placement='H')[source]

Creates a TeX float.

  • template (jinja2.Template) – the float template
  • float_type (str) – the type of float (figure or table)
  • caption (str) – the caption of the float
  • label (str) – the label of the float
  • content (str) – the content of the float
  • placement (str) – the float placement (e.g. H)

a string representation of a LaTeX float

Return type:



Creates an inline mathematical formula in TeX.

Parameters:content (str) – the content of the mathematical formula
Returns:the formatted mathematical formula
Return type:str

The function only adds $ symbols before and after the content (e.g. from \pi to $\pi$).

genipe.reporting.utils.format_time(total_seconds, written_time=False)[source]

Format time (either “HH:MM:SS” or “H hours, M minutes and S seconds”.

  • total_seconds (int) – the total number of seconds
  • written_time (bool) – whether to write time in written language

a string representation of the total time

Return type:


If written_time is True, time will be displayed as “H hours, M minutes and S seconds”. Otherwise, the time will be represented as HH:MM:SS.


Colorize the time.

Parameters:total_seconds (int) – the total number of seconds
Returns:a colorized LaTeX string representation of time
Return type:str

The time is displayed as HH:MM:SS, but insignificant zeros are grayed-out.