_as_float_vector

Signature

_as_float_vector(
    name: str,
    values: ArrayLike,
    *,
    allow_empty: bool = False,
) -> FloatVector

What problem it solves

Normalizes a numeric input into a one-dimensional, finite float64 array. It is the base check used by multiple package modules.

Input contract

  • values must be convertible with numpy.asarray(..., dtype=float).

  • The result must be one-dimensional.

  • If allow_empty=False, the array cannot be empty.

  • All elements must be finite.

Where it is used

Failure modes

  • ValueError if the input is not one-dimensional

  • ValueError if the input is empty when that is not allowed

  • ValueError if NaN values or infinities are present

Why it stays private

It is a shared infrastructure detail. Documenting it helps explain the package, but exposing it as a public API would unnecessarily constrain the internal implementation.