[TEST] Adding Sparse Triangle to Unittest - #1157
Conversation
|
@genedan can you take care of the 6 failing tests in test_slicing? |
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): 28.6% fully typed (2 / 7); 2 no longer exported
Patch symbol details
|
* 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
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.
Reviewed by Cursor Bugbot for commit 7c8e5fe. Configure here.
|
@genedan there are two more tests in test_triangle that you authored. i'm not sure if those tests should be sparse-compatible. could you please take a look? |
* 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

Summary of Changes
Fixing test fixture to supply actual sparse triangles
sped up numpy conversion of prism in
test_triangleresolved failing tests in
test_developmentadded numpy conversion in
learningto satisfy skl requirement that sample_weight is denseresolved failing test in
cape_codadded backend conversion in
mackfor sparse compatibilityadded nanquantile and nanmedian to
sparseadded new tests for nanquantile
added nan to nan_to_num in
sparseRelated GitHub Issue(s)
fixes #1155
Additional Context for Reviewers
uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)Note
Medium Risk
Changes Mack reserve uncertainty recursion and ML sample-weight preparation alongside new sparse reduction helpers; scope is moderate but touches numerically sensitive reserving code paths.
Overview
This PR fixes sparse triangle unittest coverage (#1155) by yielding real sparse-backed triangles from fixtures via
set_backendinstead of toggling globalARRAY_BACKEND, and runs largeprismtests on sparse-only (with a trimmedprism_convertfixture for auto-sparse checks).Sparse utilities gain
nanquantileandnanmedianfor COO arrays, plus a configurablenanfill innan_to_num, with new unit tests.Sparse compatibility fixes in
MackChainladderalign triangle backends before concatenation and Mack recursion (e.g. aftersumtriggers auto-sparse), andDevelopmentML._prep_w_mlforces dense numpy/cupy weights for scikit-learn.Tests are updated to use Triangle equality and numpy assertions where sparse paths differ, and CapeCod uses
atfor sparse assignment.Reviewed by Cursor Bugbot for commit ac9e1b5. Bugbot is set up for automated code reviews on this repo. Configure here.