gemseo / core / mdofunctions

Show inherited members

function_restriction module

A function mapping another one from some input components.

class gemseo.core.mdofunctions.function_restriction.FunctionRestriction(frozen_indexes, frozen_values, input_dim, mdo_function, name=None, f_type=None, expr=None, input_names=None)[source]

Bases: MDOFunction

Take an MDOFunction and apply a given restriction to its inputs.

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

Parameters:
  • frozen_indexes (ndarray[int]) – The indexes of the inputs that will be frozen

  • frozen_values (NumberArray) – The values of the inputs that will be frozen.

  • input_dim (int) – The dimension of input space of the function before restriction.

  • mdo_function (MDOFunction) – The function to restrict.

  • name (str | None) – The name of the function after restriction. If None, create a default name based on the name of the current function and on the argument input_names.

  • f_type (str | None) – The type of the function after restriction. If None, the function will have no type.

  • expr (str | None) – The expression of the function after restriction. If None, the function will have no expression.

  • input_names (Sequence[str] | None) – The names of the inputs of the function after restriction. If None, the inputs of the function will have no names.

Raises:

ValueError – If the frozen_indexes and the frozen_values arrays do not have the same shape.

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.

last_eval: OutputType | None

The value of the function output at the last evaluation.

None if it has not yet been evaluated.

special_repr: str

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