gEconpy.model.compile.stack_return_wrapper#

gEconpy.model.compile.stack_return_wrapper(f)#

Wrap a function to return a single numpy array with all outputs stacked into a single flat array.

The original function should return a list of numpy arrays. This is useful when working with the output of sympy.lambdify(), which returns one numpy array per equation in the outputs. Scipy optimize routines, on the other hand, expect a single numpy array with all outputs stacked.

Parameters:
f: Callable

The function to wrap

Returns:
inner: Callable

The wrapped function