gemseo / core / mdofunctions

Show inherited members

function_from_discipline module

The MDOFunction subclass to create a function from an MDODiscipline.

class gemseo.core.mdofunctions.function_from_discipline.FunctionFromDiscipline(output_names, mdo_formulation, discipline=None, top_level_disc=True, x_names=None, all_data_names=None, differentiable=True)[source]

Bases: LinearCandidateFunction

An MDOFunction object from an MDODiscipline.

Initialize self. See help(type(self)) for accurate signature.

Parameters:
  • output_names (Sequence[str]) – The names of the outputs.

  • mdo_formulation (BaseFormulation) – The MDOFormulation object in which the function is located.

  • discipline (MDODiscipline | None) – The discipline computing these outputs. If None, the discipline is detected from the inner disciplines.

  • top_level_disc (bool) –

    If True, search the discipline among the top level ones.

    By default it is set to True.

  • x_names (Sequence[str] | None) – The names of the design variables. If None, use self.get_x_names_of_disc(discipline).

  • all_data_names (Iterable[str] | None) – The reference data names for masking x. If None, use self.get_optim_variable_names().

  • differentiable (bool) –

    If True, then inputs and outputs are added to the list of variables to be differentiated.

    By default it is set to True.

force_real: bool

Whether to cast the results to real value.

has_default_name: bool

Whether the name has been set with a default value.

property input_dimension: int | None

The input variable dimension, needed for linear candidates.

If None this cannot be determined nor by MDODiscipline default inputs nor by MDODisciplineAdapter.__input_names_to_sizes.

last_eval: OutputType | None

The value of the function output at the last evaluation.

None if it has not yet been evaluated.

property linear_candidate: bool

Whether the final MDOFunction could be linear.

special_repr: str

The string representation of the function overloading its default string ones.