Sparse fixture - #1166
Conversation
* fixing fixture expecting errors * fixing prism * trying another approach * Sparse test fixture (#16) * fixing fixture expecting errors * fixing prism * trying another approach * some fixes * more fixes * more fixes * fix for learning * more learning fix * restoring test still fails * further improving prism_convert * capecod & mack fixes * fixing test_utilities and removing sparse.testing * more fixes * implementing nanquantile and nanmedian * Sparse fixture (#1166) * further improving prism_convert * capecod & mack fixes * fixing test_utilities and removing sparse.testing * more fixes * implementing nanquantile and nanmedian * improving comment, adding tests, fixing bugbot * fixing test * removing empty check
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): 100.0% fully typed (2 / 2)
Patch symbol details
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0f76504. Configure here.
| None | ||
| """ | ||
| a = COO(np.array([1,2,3,4])) | ||
| assert nanquantile(a,0.5) == 2.5 |
There was a problem hiding this comment.
Faulty nanquantile scalar assertion
Low Severity
nanquantile always returns a COO, so assert nanquantile(a, 0.5) == 2.5 checks truthiness of a boolean COO instead of a scalar. That can error or pass regardless of the value. Nearby checks correctly use sparse_all for COO equality.
Reviewed by Cursor Bugbot for commit 0f76504. Configure here.


Summary of Changes
Related GitHub Issue(s)
Additional Context for Reviewers
uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)Note
Low Risk
Changes are limited to tests and inline comments; production logic is unchanged except a non-functional comment in Mack
summary_.Overview
Adds unit tests for
chainladder.utils.sparse.nanquantileon 1DCOOinputs and withkeepdims=True, including imports ofnanquantileandsparse.all.Test hygiene only elsewhere: comments in
test_grain,test_development, andmack.summary_clarify defaultauto_sparse/ backend alignment;test_auto_sparse_disabled_returns_selfdocstring now documents theprism_convertfixture (reduced prism for speed).Reviewed by Cursor Bugbot for commit 0f76504. Bugbot is set up for automated code reviews on this repo. Configure here.