gemseo.algos.doe.base_doe_library module#

Base class for libraries of DOEs.

class BaseDOELibrary(algo_name)[source]#

Bases: BaseDriverLibrary, Serializable

Base class for libraries of DOEs.

Parameters:

algo_name (str) -- The algorithm name.

Raises:

KeyError -- When the algorithm is not in the library.

compute_doe(variables_space, unit_sampling=False, settings_model=None, **settings)[source]#

Compute a design of experiments (DOE) in a variables space.

Parameters:
  • variables_space (DesignSpace | int) -- Either the variables space to be sampled or its dimension.

  • unit_sampling (bool) --

    Whether to sample in the unit hypercube. If the value provided in variables_space is the dimension, the samples will be generated in the unit hypercube whatever the value of unit_sampling.

    By default it is set to False.

  • settings_model (BaseDOESettings | None) -- The DOE settings as a Pydantic model. If None, use **settings.

  • **settings (DriverSettingType) -- The DOE settings. These arguments are ignored when settings_model is not None.

Returns:

The design of experiments whose rows are the samples and columns the variables.

Return type:

RealArray

lock: RLock#

The lock protecting database storage in multiprocessing.

samples: RealArray#

The design vector samples in the design space.

The design space variable types stored as dtype metadata.

To access those in the unit hypercube, use unit_samples.

property seed: int#

The default seed used for reproducibility reasons.

unit_samples: RealArray#

The design vector samples projected in the unit hypercube.

In the case of a design space of dimension \(d\), the unit hypercube is \([0,1]^d\).

To access those in the design space, use samples.

class DOEAlgorithmDescription(algorithm_name, internal_algorithm_name, library_name='', description='', website='', Settings=<class 'gemseo.algos.doe.base_doe_settings.BaseDOESettings'>, handle_integer_variables=True, minimum_dimension=1)[source]#

Bases: DriverDescription

The description of a DOE algorithm.

Parameters:
  • algorithm_name (str)

  • internal_algorithm_name (str)

  • library_name (str) --

    By default it is set to "".

  • description (str) --

    By default it is set to "".

  • website (str) --

    By default it is set to "".

  • Settings (type[BaseDOESettings]) --

    By default it is set to <class 'gemseo.algos.doe.base_doe_settings.BaseDOESettings'>.

  • handle_integer_variables (bool) --

    By default it is set to True.

  • minimum_dimension (int) --

    By default it is set to 1.

Settings#

The Pydantic model for the DOE library settings.

alias of BaseDOESettings

handle_integer_variables: bool = True#

Whether the optimization algorithm handles integer variables.

minimum_dimension: int = 1#

The minimum dimension of the parameter space.

CallbackType(*args, **kwargs)#

The type of a callback function.

alias of Callable[[int, tuple[dict[str, float | ndarray[Any, dtype[floating[Any]]]], dict[str, ndarray[Any, dtype[floating[Any]]]]]], Any]