gemseo.core.mdo_functions.collections.functions module#

A mutable sequence of functions.

class Functions[source]#

Bases: MutableSequence[MDOFunction]

A mutable sequence of functions.

evaluate(input_value)[source]#

Evaluate all the functions given an input value.

Parameters:

input_value (RealArray) -- The input value at which to evaluate the functions.

Return type:

None

Note

This method does not return the output values.

format(function)[source]#

Format a function.

Parameters:

function (MDOFunction) -- The function.

Returns:

A formatted function or None.

Return type:

MDOFunction

static get_dimension(functions)[source]#

Compute the sum of the output dimensions of functions.

Parameters:

functions (Iterable[MDOFunction]) -- The functions.

Returns:

The dimension.

Raises:

ValueError -- When the dimension of a function output is not available yet.

Return type:

int

get_from_name(name, get_original=False)[source]#

Return a function from its name.

Parameters:
  • name (str) -- The name of the function.

  • get_original (bool) --

    Whether to consider the original function.

    By default it is set to False.

Returns:

The function.

Raises:

ValueError -- When there is no function with this name.

Return type:

MDOFunction

get_names()[source]#

Return the names of the functions.

Returns:

The names of the functions.

Return type:

list[str]

get_originals()[source]#

Return the original functions.

Yields:

The original functions.

Return type:

Iterator[MDOFunction]

insert(index, function)[source]#

S.insert(index, value) -- insert value before index

Parameters:
Return type:

None

reset()[source]#

Reset the functions.

Return type:

None

property dimension: int#

The sum of the output dimensions of the functions.

evaluate_jacobian: bool#

Whether the evaluate() method has to evaluate the Jacobian.

property original_to_current_names: dict[str, list[str]]#

The current function names bound to the original ones.