pyGAM
pyGAM copied to clipboard
Improve test coverage for utils.py (87% → >95%)
This PR improves test coverage for pygam/utils.py by adding comprehensive unit tests that cover edge cases, invalid inputs, dimensional inconsistencies, and boundary conditions.
Coverage increased from approximately 87% to above 95%
All changes are isolated to pygam/tests/test_utils.py. No modifications were made to production code.
New tests cover:
- parameter validation and constraint checking in
check_param - shape mismatch detection in
check_arrayandcheck_lengths - tensor dimension validations in
tensor_product - invalid spline configurations in
b_spline_basis - sparse/dense fallback behavior in
cholesky - recursive parameter expansion in
combine - rounding edge cases for scientific notation inputs
- unsupported dtype handling and warnings in
gen_edge_knots
These tests improve coverage of previously untested validation paths and exception handling in the utility layer.
All tests pass locally with:
pytest --cov=pygam