Numeric Typing
Buffalo Core provides shared numeric type aliases for Buffalo projects that use NumPy-heavy scientific code. The goal is to keep public signatures consistent across projects while still allowing ergonomic scalar inputs where appropriate.
Core Aliases
Use buffalo_core.typing.FloatScalar for one floating-point value, including NumPy floating scalars.
Use buffalo_core.typing.FloatArray for float64 NumPy arrays.
Use buffalo_core.typing.FloatInput for input parameters that may be a scalar, a sequence of scalars, or a NumPy floating array.
Use buffalo_core.typing.IntScalar for one integer value, including NumPy integer scalars.
Use buffalo_core.typing.IntArray for int32 NumPy arrays.
Use buffalo_core.typing.IntInput for input parameters that may be a scalar, a sequence of scalars, or a NumPy integer array.
Normalization Rule
Flexible numeric inputs should be normalized at function boundaries.
Use buffalo_core.numeric.as_float_array for floating-point inputs and buffalo_core.numeric.as_int_array for integer inputs.
When a true Python scalar is required for a third-party boundary or public return value, use buffalo_core.numeric.as_float_scalar or buffalo_core.numeric.as_int_scalar.
Design Intent
These aliases are meant to support shared scientific-programming conventions across Buffalo projects. They are intentionally low level and domain independent. They should make signatures easier to read without forcing each project to reinvent the same NumPy typing patterns.