gemseo / problems / mdo / scalable / data_driven

Show inherited members

factory module

Scalable model factory.

This module contains the ScalableModelFactory which is a factory to create a ScalableModel from its class name by means of the ScalableModelFactory.create() method. It is also possible to get a list of available scalable models (see ScalableModelFactory.scalable_models method) and to check is a type of scalable model is available (see ScalableModelFactory.is_available() method)

class gemseo.problems.mdo.scalable.data_driven.factory.ScalableModelFactory[source]

Bases: BaseFactory

This factory instantiates a class:.ScalableModel from its class name.

The class can be internal to GEMSEO or located in an external module whose path is provided to the constructor.

Return type:

Any

create(model_name, data, sizes=None, **parameters)[source]

Create a scalable model.

Parameters:
  • model_name (str) – The name of the scalable model (its class name).

  • data (IODataset) – The input-output dataset.

  • sizes (Mapping[str, int] | None) – The sizes of the inputs and outputs. If None, use the original sizes.

  • **parameters (Any) – model parameters

Returns:

The scalable model.

Raises:

TypeError – If the class cannot be instantiated.

Return type:

ScalableModel

failed_imports: dict[str, str]

The class names bound to the import errors.

property scalable_models: list[str]

The available scalable models.