Triangle slicer tests (Part 2)#950
Open
genedan wants to merge 6 commits into
Open
Conversation
…te TriangleProtocol class as common interface for Triangle mixins.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #950 +/- ##
==========================================
+ Coverage 88.79% 89.17% +0.37%
==========================================
Files 89 89
Lines 5060 5089 +29
Branches 646 648 +2
==========================================
+ Hits 4493 4538 +45
+ Misses 423 414 -9
+ Partials 144 137 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Follow up to #948 (review that one first). The size of this one should get smaller assuming the previous gets merged in.
Adds type hints and annotations to
At,Iat, andVirtualColumnsclasses. Adds tests to cover missing lines. Cleans up dead code found in #949. Achieves 100% coverage forslicing.py.Gonna take the next few days off, so I really wanted to finish this up. I'm probably going to be dreaming about slicing triangles tonight...
Related GitHub Issue(s)
#486
#949
Additional Context for Reviewers
uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)Note
Medium Risk
Changes touch core indexing and column assignment on numpy and sparse backends;
.atvalidation is stricter and may reject keys that previously slipped through.Overview
Adds static typing for Triangle slicing: a
BackendArrayalias andTriangleProtocolfor mixins, plus annotations acrossTriangleSlicer,.at/.iat, andVirtualColumns.At._check_indexnow requires all four axes explicitly (no ellipsis), treats full-axisslice(None)as valid only when that axis has size 1, and uses clearer validation instead of deadnextbranches.Behavioral cleanups include
_to_scalarfor sparse.at/.iatassignment from single-cell Triangles,isinstance-based[]slicing/__setitem__, scalar broadcast when adding new columns, andValueErrorinstead of a bareexceptfor misaligned column concat. Sparse column replace paths are refactored for clarity without changing intent.Tests expand coverage for
.atrules, column/virtual-column assignment, backend conversion, misaligned origins, and sparse.iatwith Triangle values—aiming at full coverage ofslice.py.Reviewed by Cursor Bugbot for commit 2df561b. Bugbot is set up for automated code reviews on this repo. Configure here.