gEconpy.model.perturbation.override_dummy_wrapper#
- gEconpy.model.perturbation.override_dummy_wrapper(f, param_name='not_loglin_variable')#
Wrap a function to map a parameter name to a _Dummy argument in a sympy lambdify generated function.
To have a 1d array input to a sympy lambdify function, it is necessary to use an IndexBase. IndexBase, unfortunately, always ends up as a Dummy value when lambdified. This wrapper finds a single dummy value in a function signature, and automatically maps the parameter name to it.
- Parameters:
- f: Callable
Function generated by sympy.lambidfy, with exactly one dummy variable
- param_name: str
Named arugment that will be mapped to the dummy in the wrapped function
- Returns:
- inner:
Callable Same as f, with a keyword argument “param_name” that maps to the Dummy input
- inner: