osl_dynamics.utils.model#
Utility classes and functions related to the models.
Classes#
A simple table class that stores data in rows and columns. |
|
Class for creating HTML tables. |
|
Class for creating LaTeX tables. |
Functions#
|
Escape characters which require control sequences in text for use in LaTeX. |
Module Contents#
- osl_dynamics.utils.model.tex_escape(text)[source]#
Escape characters which require control sequences in text for use in LaTeX.
- Parameters:
text (str) – Text to be escaped.
- Returns:
escaped_text – Escaped text.
- Return type:
str
- class osl_dynamics.utils.model.Table(headers)[source]#
A simple table class that stores data in rows and columns.
- Parameters:
headers (list) – List of strings for the table headers.
- class osl_dynamics.utils.model.HTMLTable(headers)[source]#
Bases:
TableClass for creating HTML tables.
- Parameters:
headers (List[str])
- append_last(item)[source]#
Append an item to the last cell in the last row.
- Parameters:
item (str) – The string to append to the cell.
- Return type:
None
- html_row(items)[source]#
Format a list of strings as an HTML table row.
- Parameters:
items (list of str) – A list of
strto be added to the HTML table.- Returns:
html – The HTML table row.
- Return type:
str
- class osl_dynamics.utils.model.LatexTable(headers, *, vertical_lines=True, horizontal_lines=True, header_lines=True)[source]#
Bases:
TableClass for creating LaTeX tables.
- Parameters:
headers (List[str])
vertical_lines (bool)
horizontal_lines (bool)
header_lines (bool)
- header_lines#
Whether to draw horizontal lines above the header, by default
True.- Type:
bool, optional
- append_last(item)[source]#
Append an item on the last row of the table.
- Parameters:
item (any) – Item to append.
- Return type:
None