gemseo / formulations

formulations_factory module

A factory to instantiate a formulation or check its availability.

class gemseo.formulations.formulations_factory.MDOFormulationsFactory[source]

Bases: BaseFormulationsFactory

A factory of MDOFormulation.

Parameters:
  • cls – The base class.

  • module_names – The names of the modules to search in.

create(formulation_name, disciplines, objective_name, design_space, maximize_objective=False, **options)

Create a formulation.

Parameters:
  • formulation_name (str) – The name of a class implementing a formulation.

  • disciplines (Sequence[MDODiscipline]) – The disciplines.

  • objective_name (str) – The name(s) of the discipline output(s) used as objective. If multiple names are passed, the objective will be a vector.

  • design_space (DesignSpace) – The design space.

  • maximize_objective (bool) –

    Whether to maximize the objective.

    By default it is set to False.

  • **options – The options for the creation of the formulation.

Return type:

BaseFormulation

is_available(formulation_name)

Check the availability of a formulation.

Parameters:

formulation_name (str) – The formulation name to check.

Returns:

Whether the formulation is available.

Return type:

bool

property formulations: list[str]

The available formulations.