gemseo.disciplines.array_based_function module#
A discipline wrapping an array-based Python function.
- class ArrayBasedFunctionDiscipline(function, input_names_to_sizes, output_names_to_sizes, jac_function=None)[source]#
Bases:
Discipline
A discipline wrapping an array-based function.
Both the unique argument of this Python function and its return value are NumPy arrays.
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
function (Callable[[RealArray], RealArray]) -- The function of interest whose both the unique argument and the output are NumPy arrays.
input_names_to_sizes (dict[str, int]) -- The mapping from the names to the sizes for the input.
output_names_to_sizes (dict[str, int]) -- The mapping from the names to the sizes for the output.
jac_function (Callable[[RealArray], RealArray] | None) -- The function computing the derivatives of the function of interest; both its unique argument and its output (i.e. a Jacobian matrix) are NumPy arrays. If
None
, the derivatives will have to be approximated if required.