_validate_positive_vector

Signature

_validate_positive_vector(
    name: str,
    values: ArrayLike,
    *,
    expected_shape: tuple[int, ...] | None = None,
) -> FloatVector

What problem it solves

Validates vectors that must be numeric, one-dimensional, finite, and strictly positive. In fit_utils it is mainly used for sigma_y and sigma_x.

Input contract

  • The base conversion passes through _as_float_vector.

  • If expected_shape is provided, the vector shape must match exactly.

  • Each element must be greater than zero.

Where it is used

Failure modes

  • ValueError if the input does not pass the _as_float_vector checks

  • ValueError if the shape does not match expected_shape

  • ValueError if at least one value is less than or equal to zero

Why it stays private

It is a validator tightly tied to the package’s linear-fit domain. Keeping it internal avoids promising a general-purpose semantics for all positive vectors.