check_larger_than#

check_larger_than(min_value: Number, value: Number, name: str, allow_none: bool = False) Number[source]#

Check if value is non-negative.

Parameters:
min_valueint, float

Minimum allowed value.

valueint, float

Value to check.

namestr

Name of the parameter to be shown in the error message.

allow_nonebool, optional (default=False)

Whether to allow None values.

Returns:
valueint, float

Input value.

Raises:
ValueError

If value is negative.