Summary
Most numeric builder arguments use XY's canonical validation rule: reject booleans, coerce numeric scalar-likes, reject NaN/infinity, and raise a contextual ValueError. x_axis() and y_axis() bypass that rule for major and minor tick values by calling float() directly.
Audited at 99eda6d.
Current behavior
Both axis factories convert tick_values and minor_tick_values with raw list comprehensions in x_axis() and y_axis().
Consequences include:
tick_values=[True] is accepted as [1.0];
NaN and positive/negative infinity are accepted into a public axis spec;
- invalid values leak raw
float() conversion messages rather than a stable error naming the axis and tick index.
The repository already has the intended primitive in _validate.finite_scalar.
Proposed direction
Add a small shared sequence validator that applies finite_scalar with indexed labels, and use it for major and minor tick values on both axes (and any equivalent polar-axis input that shares the same public contract).
Acceptance criteria
Summary
Most numeric builder arguments use XY's canonical validation rule: reject booleans, coerce numeric scalar-likes, reject NaN/infinity, and raise a contextual
ValueError.x_axis()andy_axis()bypass that rule for major and minor tick values by callingfloat()directly.Audited at
99eda6d.Current behavior
Both axis factories convert
tick_valuesandminor_tick_valueswith raw list comprehensions inx_axis()andy_axis().Consequences include:
tick_values=[True]is accepted as[1.0];NaNand positive/negative infinity are accepted into a public axis spec;float()conversion messages rather than a stable error naming the axis and tick index.The repository already has the intended primitive in
_validate.finite_scalar.Proposed direction
Add a small shared sequence validator that applies
finite_scalarwith indexed labels, and use it for major and minor tick values on both axes (and any equivalent polar-axis input that shares the same public contract).Acceptance criteria
ValueErrornamingx_axis/y_axis, the argument, and ideally the index.