Abstract Base Classes#

This module provides abstract base classes for defining a test function class.

UQTestFunBareABC Abstract Base Class#

class uqtestfuns.core.uqtestfun_abc.UQTestFunBareABC(prob_input: ProbInput, parameters: FunParams, function_id: str | None = None)#

An abstract class for a bare UQ test functions.

Parameters:
  • prob_input (ProbInput) – The probabilistic input model of the UQ test function.

  • parameters (Any, optional) – A set of parameters. By default, it is None.

  • function_id (str, optional) – The ID of the UQ test function. By default, it is None.

Notes

  • A bare UQ test function only includes the evaluation function, probabilistic input model, parameters, and a (optional) ID.

abstract static evaluate(xx: ndarray, **kwargs) ndarray#

Abstract method for the implementation of the UQ test function.

property function_id: str | None#

The ID of the UQ test function.

property input_dimension: int#

The input dimension of the UQ test function.

property output_dimension: int | Tuple[int, ...]#

The output dimension of the UQ test function.

property parameters: FunParams#

The parameters of the UQ test function.

property prob_input: ProbInput#

The probabilistic input model of the UQ test function.

transform_sample(xx: ndarray, min_value=-1.0, max_value=1.0) ndarray#

Transform sample values from a unif. domain to the func. domain

Parameters:
  • xx (np.ndarray) – Sampled input values (realizations) in a uniform bounded domain. By default, the uniform domain is [-1.0, 1.0].

  • min_value (float, optional) – Minimum value of the uniform domain. Default value is -1.0.

  • max_value (float, optional) – Maximum value of the uniform domain. Default value is 1.0.

Returns:

Transformed sampled values from the specified uniform domain to the domain of the function as defined the input property.

Return type:

np.ndarray

UQTestFunABC Abstract Base Class#

class uqtestfuns.core.uqtestfun_abc.UQTestFunABC(prob_input: ProbInput, parameters: FunParams, function_id: str | None = None)#

An abstract class for (published) UQ test functions.

Parameters:
  • input_dimension (int, optional) – The input dimension of the UQ test function. This is used only when the function supports variable dimension; otherwise, if specified, an exception is raised. In the case of functions with variable dimension, the default dimension is set to 2. This is a keyword only parameter.

  • input_id (str, optional) – The selection of probabilistic input model; this is used when there are multiple input specifications in the literature. This is a keyword only parameter.

  • parameters_id (str, optional) – The selection of parameters set; this is used when there are multiple sets of parameters available in the literature. This is a keyword only parameter.

  • function_id (str, optional) – The ID of the UQ test function. If not given, None is used as the function ID. This is a keyword only parameter.

Notes

  • A published UQ test function includes a couple of additional metadata, namely tags and description.

Raises:
  • KeyError – If selection is not in the list of available inputs and parameters.

  • TypeError – If input dimension is specified for a UQ test function with a fixed dimension.

property available_inputs: Dict[str, ProbInputSpec]#

All the keys to the available probabilistic input specifications.

property available_parameters: Dict[str, FunParamsSpec] | None#

All the keys to the available set of parameter values.

property description: str | None#

Short description of the UQ test function.

property tags: List[str]#

Tags to classify different UQ test functions.

UQTestFunFixDimABC Abstract Base Class#

class uqtestfuns.core.uqtestfun_abc.UQTestFunVarDimABC(input_dimension: int = 2, *, input_id: str | None = None, parameters_id: str | None = None, function_id: str | None = None)#

An abstract class for (published) variable-dimension UQ test functions.

Parameters:
  • input_dimension (int, optional) – The input dimension of the UQ test function. This is used only when the function supports variable dimension; otherwise, if specified, an exception is raised. In the case of functions with variable dimension, the default dimension is set to 2.

  • input_id (str, optional) – The selection of probabilistic input model; this is used when there are multiple input specifications in the literature. This is a keyword only parameter.

  • parameters_id (str, optional) – The selection of parameters set; this is used when there are multiple sets of parameters available in the literature. This is a keyword only parameter.

  • function_id (str, optional) – The ID of the UQ test function. If not given, None is used as the function ID. This is a keyword only parameter.

Notes

  • A published UQ test function includes a couple of additional metadata, namely tags and description.

Raises:
  • KeyError – If selection is not in the list of available inputs and parameters.

  • TypeError – If input dimension is specified for a UQ test function with a fixed dimension.

UQTestFunVarDimABC Abstract Base Class#

class uqtestfuns.core.uqtestfun_abc.UQTestFunFixDimABC(*, input_id: str | None = None, parameters_id: str | None = None, function_id: str | None = None)#

An abstract class for (published) fixed-dimension UQ test functions.

Parameters:
  • input_id (str, optional) – The selection of probabilistic input model; this is used when there are multiple input specifications in the literature. This is a keyword only parameter.

  • parameters_id (str, optional) – The selection of parameters set; this is used when there are multiple sets of parameters available in the literature. This is a keyword only parameter.

  • function_id (str, optional) – The ID of the UQ test function. If not given, None is used as the function ID. This is a keyword only parameter.

Notes

  • A published UQ test function includes a couple of additional metadata, namely tags and description.

Raises:
  • KeyError – If selection is not in the list of available inputs and parameters.

  • TypeError – If input dimension is specified for a UQ test function with a fixed dimension.

property variable_dimension: bool#

Return False due to fixed dimension function.