Repository navigation
[BUG] dev_to_val and val_to_dev does not respect inplace - #1480
henrydingliu wants to merge 14 commits into
Conversation
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): 66.7% fully typed (2 / 3)
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.
Reviewed by Cursor Bugbot for commit 76cf401. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1480 +/- ##
==========================================
+ Coverage 94.15% 94.18% +0.03%
==========================================
Files 96 96
Lines 5852 5851 -1
Branches 739 734 -5
==========================================
+ Hits 5510 5511 +1
+ Misses 221 220 -1
+ Partials 121 120 -1
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:
|

Summary of Changes
Related GitHub Issue(s)
closes #1477
closes #1482
AI/LLM Usage
None
Additional Context for Reviewers
inplace=False.Submitter's Checklist
[FIX],[FEAT],[DOCS],[TST],[CHORE], or[BRK]).Reviewer's Checklist
Note
Medium Risk
Changes behavior of widely used development/valuation conversion methods and inplace return values; incorrect backend restoration could affect sparse vs numpy performance or memory for large triangles.
Overview
Fixes
dev_to_valandval_to_devsoinplace=Truemutates the triangle and returnsNone, whileinplace=Falsereturns a newTriangle(copy-then-mutate). Docstrings now documentTriangle | Nonereturn types.The private
_val_devhelper is in-place only: it temporarily switches to sparse for the coordinate reshape, thenset_backendrestores the caller’s original backend instead of routing through_auto_sparse(which could flip sparse triangles back to numpy during conversion)._auto_sparseis aligned with its existing mutation behavior by returningNone; aggregation paths inpandas.pyand triangle construction call it without reassigningself.Tests are updated for inplace semantics,
_auto_sparseexpectations, grain assertions viato_frame(), and a newtest_dev_val_inplace.Reviewed by Cursor Bugbot for commit 3279003. Bugbot is set up for automated code reviews on this repo. Configure here.