module documentation

Utility functions for the halfspace package.

Function check_scalar Check that a scalar satisfies certain conditions.
Function log_table_header Log a table header.
Function log_table_row Log a table row.
def check_scalar(x: Any, name: str, var_type: Optional[Union[Type, tuple[Type, ...]]] = None, lb: Optional[Union[float, int]] = None, ub: Optional[Union[float, int]] = None, include_boundaries: bool = True): (source)

Check that a scalar satisfies certain conditions.

Returns: None

Parameters
x:AnyAny The scalar to check.
name:strstr, The name of the scalar. Used for error messages.
var_type:Optional[Union[Type, tuple[Type, ...]]]type or tuple of types, default=`None` The expected type(s) of the scalar. If None, then no type checking is performed.
lb:Optional[Union[float, int]]float or int, default=`None` The lower bound of the scalar. If None, then no lower bound checking is performed.
ub:Optional[Union[float, int]]float or int, default=`None` The upper bound of the scalar. If None, then no upper bound checking is performed.
include_boundaries:boolbool, default=`True` Whether to include the boundaries in the bound checking.
def log_table_header(columns: Iterable[str], width: int = 15): (source)

Log a table header.

Logging level is set to logging.INFO.

Returns: None

Parameters
columns:Iterable[str]iterable of str The column names of the table
width:intint, default=15 The width of each column.
def log_table_row(values: Iterable[Union[float, int]], width: int = 15): (source)

Log a table row.

Logging level is set to logging.INFO.

Returns: None

Parameters
values:Iterable[Union[float, int]]iterable of str The values of the row.
width:intint, default=15 The width of each column.