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 dictionary of a model and transform it into a readable string |
- validate_init_parameters(model_class, input_param_dict: dict)
Validate the type and value of a list of parameters according to a provided dictionary.
- Parameters:
model_class (class) – 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)
- Take the valid parameters dictionary of a model and transform it into a readable string
format for the purpose of displaying 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