eelib.utils.validation
Provide a dictionary of type and value validation rules and validate given parameters or print a readable string of the given set of rules.
Module Contents
Functions
|
Validate the type and value of a list of parameters according to a provided dictionary. |
Take the valid parameters dict and transform it into a readable string format to display it. |
- validate_init_parameters(model_class: object, input_param_dict: dict)
Validate the type and value of a list of parameters according to a provided dictionary.
- Parameters:
model_class (object) – a class representing a component. This should contain a method get_valid_parameters() that returns a dictionary.
input_param_dict (dict) – a dictionary of parameter name value pairs to be assessed and validated.
- Raises:
TypeError – Invalid parameter input types
ValueError – Invalid parameter input values
- format_valid_parameters_dictionary(valid_parameters: dict) str
Take the valid parameters dict and transform it into a readable string format to display it.
- Parameters:
valid_parameters (dict) – a dictionary representing valid parameter types and values
- Returns:
Message string with the collected errors from input validation
- Return type:
str