Module functions.graphy.main_functions

Functions

def none_to_dict(variable) ‑> dict

Converts variable to empty dictionary if None

def none_to_list(variable) ‑> list

Converts variable to empty list if None

def raise_errors(globals_dict: dict, variable: Any, type: Any, min_value: Union[float, int, ForwardRef(None)] = None, max_value: Union[float, int, ForwardRef(None)] = None, min_length: Optional[int] = None, max_length: Optional[int] = None) ‑> None

raises errors if there are invalid parameters

Args

globals_dict : dict
all variables
variable : Any
variable to check
type : Any
assumed type of the parameter
min_value : Union[float, int, None], optional
minimum value of the parameter. Defaults to None.
max_value : Union[float, int, None], optional
maximum value of the parameter. Defaults to None.
min_length : Optional[int], optional
minimum length of the parameter. Defaults to None.
max_length : Optional[int], optional
maximum length of the parameter. Defaults to None.

Raises

ValueError
if a parameter has the wrong value
TypeError
if a parameter has the wrong type
NotImplementedError
if a type of parameter is not implemented