gemseo / core / mdofunctions

Show inherited members

linear_candidate_function module

Linear candidate function.

class gemseo.core.mdofunctions.linear_candidate_function.LinearCandidateFunction(func, name, f_type=FunctionType.NONE, jac=None, expr='', input_names=None, dim=0, output_names=None, force_real=False, special_repr='', original_name='')[source]

Bases: MDOFunction

MDOFunction that may be linearized in a Scenario.

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

Parameters:
  • func (WrappedFunctionType | None) – The original function to be actually called. If None, the function will not have an original function.

  • name (str) – The name of the function.

  • f_type (FunctionType) –

    The type of the function.

    By default it is set to “”.

  • jac (WrappedJacobianType | None) – The original Jacobian function to be actually called. If None, the function will not have an original Jacobian function.

  • expr (str) –

    The expression of the function, e.g. “2*x”, if any.

    By default it is set to “”.

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

  • dim (int) –

    The dimension of the output space of the function. If 0, the dimension of the output space of the function will be deduced from the evaluation of the function.

    By default it is set to 0.

  • output_names (Iterable[str] | None) – The names of the outputs of the function. If None, the outputs of the function will have no names.

  • force_real (bool) –

    Whether to cast the output values to real.

    By default it is set to False.

  • special_repr (str) –

    The string representation of the function. If empty, use default_repr().

    By default it is set to “”.

  • original_name (str) –

    The original name of the function. If empty, use the same name than the name input.

    By default it is set to “”.

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.

abstract 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.

abstract 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.