_validate_decimals

Signature

_validate_decimals(decimals: int) -> int

What problem it solves

Ensures that the precision used for labels and legends remains readable and consistent across the package plotting functions.

Input contract

  • decimals must be a real integer or an np.integer.

  • Booleans are explicitly rejected.

  • The value must be between 0 and 20.

Where it is used

  • in histogram to format ticks, the mean, and the band

  • in lin_fit to format the fit legend when needed

How it fails

  • ValueError if decimals is not an integer

  • ValueError if decimals < 0

  • ValueError if decimals > 20

Why it remains private

It is a presentation-oriented validation rule, shared internally by the plotting APIs but not intended as a standalone public utility.