gemseo / problems / scalable

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.scalable.factory.ScalableModelFactory[source]

Bases: object

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.

Initializes the factory: scans the directories to search for subclasses of ScalableModel. Searches in “GEMSEO_PATH” and gemseo.caches

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

Create a scalable model

Parameters
  • model_name (str) – name of the scalable model (its classname)

  • data (AbstractFullCache) – learning dataset.

  • sizes (dict) – sizes of input and output variables. If None, use the original sizes. Default: None.

  • parameters – model parameters

Returns

model_name scalable model

is_available(model_name)[source]

Checks the availability of a scalable model.

Parameters

name (str) – model_name of the scalable model.

Returns

True if the scalable model is available.

Return type

bool

property scalable_models

Lists the available classes for scalable models.

Returns

the list of classes names.

Return type

list(str)