gana.sets.parameter#
Paramter Set
Functions
|
Display a Python object in all frontends. |
|
Plot the variable set |
|
Make input into a theta set (T) |
|
Issue a warning, or maybe ignore it or raise an exception. |
Classes
|
Type of function |
|
Provides relational operations between parameter, variable, parametric variable, or function sets (F). |
|
Set of index elements (X). |
|
|
|
Ordered set of parameters. |
|
parameter cases |
|
Ordered set of variables (Var). |
|
Cartesian product of input iterables. |
- class P(*index: I, _: list[float] | float | None = None, mutable: bool = False, tag: str = '', ltx: str = '', name: str = '')[source]#
Bases:
_EOrdered set of parameters.
Does not support inf or nan values.
- Parameters:
index (tuple[I], optional) – Indices of the parameter set.
_ (list[int | float], optional) – List of parameters. All values are converted to float.
mutable (bool, optional) – If the parameter set is mutable.
tag (str, optional) – Tag/details
- Variables:
index (I) – Index of the parameter set
_ (list[int | float]) – List of parameters (converted to float)
mutable (bool) – If the parameter set is mutable
tag (str) – Tag/details
name (str) – Name, set by the program
n (int) – Number id, set by the program
map (dict[X | Idx, Var]) – Index to parameter mapping
case (PCase) – Special case of the parameter set
- Raises:
ValueError – If != operator is used with any type other than P
ValueError – If the parameter values and the length of indices do not match
- property args: dict[str, str | bool]#
Return the arguments of the parameter set
- property A: list[list[float]]#
Generate a diagonal matrix representation of the variable set
- property ltx: str#
LaTeX representation
- property index_ltx: str#
LaTeX representation of the index
- latex() str[source]#
LaTeX representation
- Returns:
LaTeX representation of the parameter set
- Return type:
str
- show(descriptive: bool = False)[source]#
Display the variables
- Args:
descriptive (bool, optional): If True, shows all parameters. Defaults to False.
- line(font_size: float = 16, fig_size: tuple[float, float] = (12, 6), linewidth: float = 0.7, color: str = 'blue', grid_alpha: float = 0.3, usetex: bool = True, str_idx_lim: int = 10)[source]#
Plot the parameter set
- Parameters:
font_size (float, optional) – Font size for the plot. Defaults to 16.
fig_size (tuple[float, float], optional) – Size of the figure. Defaults to (12, 6).
linewidth (float, optional) – Width of the line in the plot. Defaults to 0.7.
color (str, optional) – Color of the line in the plot. Defaults to ‘blue’.
grid_alpha (float, optional) – Transparency of the grid lines. Defaults to 0.3.
usetex (bool, optional) – Use LaTeX for text rendering. Defaults to True.
str_idx_lim (int, optional) – Limit for string indices display. Defaults to 10.
- bar(font_size: float = 16, fig_size: tuple[float, float] = (12, 6), linewidth: float = 0.7, color: str = 'blue', grid_alpha: float = 0.3, usetex: bool = True, str_idx_lim: int = 10)[source]#
Plot the parameter set
- Parameters:
font_size (float, optional) – Font size for the plot. Defaults to 16.
fig_size (tuple[float, float], optional) – Size of the figure. Defaults to (12, 6).
linewidth (float, optional) – Width of the line in the plot. Defaults to 0.7.
color (str, optional) – Color of the line in the plot. Defaults to ‘blue’.
grid_alpha (float, optional) – Transparency of the grid lines. Defaults to 0.3.
usetex (bool, optional) – Use LaTeX for text rendering. Defaults to True.
str_idx_lim (int, optional) – Limit for string indices display. Defaults to 10.