Numeric Types

Hypster provides flexible numeric parameter configuration through int, multi_int, float, and multi_float methods. These methods support automatic validation with optional bounds checking.

Numeric Parameters

Function Signatures

Integer Methods

def int(
    default: int,
    *,
    name: str,
    min: Optional[int] = None,
    max: Optional[int] = None
) -> int

def multi_int(
    default: List[int] = [],
    *,
    name: str,
    min: Optional[int] = None,
    max: Optional[int] = None
) -> List[int]

Float Methods

Type Specificity

Float vs Integer

  • float/multi_float: Accepts floating-point values only

  • int/multi_int: Accepts integer values only

The first argument in both methods is the default value:

Bounds Validation

All numeric parameters support optional minimum and maximum bounds:

Valid Examples

Invalid Examples

Complete Example

Last updated

Was this helpful?