skshapes.input_validation.notnone_rules.no_more_than_one
- skshapes.input_validation.notnone_rules.no_more_than_one(parameters)
Checker for less than one not None parameter.
- Parameters:
parameters (list[str]) – the list of parameters to check
- Returns:
the decorated function
- Return type:
callable
- Raises:
InputStructureError – if more than one parameter is not None
Examples
from skshapes.input_validation import no_more_than_one @no_more_than_one(["a", "b"]) def func(a=None, b=None): pass func() func(a=1) func(b=1) func(a=1, b=1)
Traceback (most recent call last): ... skshapes.errors.InputStructureError: No more than one of the parameters ['a', 'b'] must be not None and they must be passed as keyword arguments.