Function Parameters#
This module contains the implementation of FunParams a class that stores UQ Test function parameters.
- class uqtestfuns.core.parameters.FunParams(function_id: str = '', parameter_id: str = '', description: str = '', declared_parameters: List[DeclaredParameter] | None = None)#
A class that stores UQ Test function parameters.
- Parameters:
function_id (str, optional.) – The UQ test function ID (typically the name of the test function). If not provided, an empty string is used.
parameter_id (str, optional) – The ID of the parameter set. If not provided, an empty string is used.
description (str, optional) – Descriptive string of the parameter set. If not provided, an empty string is used.
declared_parameters (List[dict], optional) – List of dictionaries containing the UQ test function parameters with the following keywords: ‘keyword’, ‘value’, ‘type’, ‘description’. ‘keyword’ value is a string that appears in the evaluation function. The value is None if not provided.
- add(keyword: str, value: Any, type: type | None = None, description: str | None = '') None#
Add a parameter to the parameter set.
- Parameters:
keyword (str) – The name of the parameter as it appears in the evaluation function signature; must be a valid Python identifier.
value (Any) – The default value of the parameter.
type (Optional[type]) – The type of the parameter. If given, the type will be used to validate the provided value.
description (str, optional) – The description of the parameter.
- as_dict()#
Return key-value pairs of the parameter set.
- reset_value() None#
Reset the value of the parameter set to the declared values.