wildboar.utils.decorators#
Module Contents#
Functions#
|
Decorate a function returning an ndarray to return a single scalar if the array |
|
Recursivley try to unwrap list return arguments such that a single element can |
- wildboar.utils.decorators.array_or_scalar(optional_f=None, squeeze=True)[source]#
Decorate a function returning an ndarray to return a single scalar if the array has a single item.
- Parameters:
optional_f (callable, optional) – Used if the decorator is used without arguments
squeeze (bool, optional) – Remove axis of length one from the returned arrays