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): 20.0% fully typed (3 / 15)
Patch symbol details
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1422 +/- ##
==========================================
+ Coverage 92.36% 92.40% +0.04%
==========================================
Files 102 102
Lines 5864 5940 +76
Branches 723 744 +21
==========================================
+ Hits 5416 5489 +73
- Misses 326 328 +2
- Partials 122 123 +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:
|
|
@priyam0k thanks for putting this together!
|
|
Thanks @henrydingliu! Added apply_from_triangle and routed both highlight methods through it. For the slicing shortcut, slicing a past diagonal drops newer origin years that are all NaN (for example, 10x10 becomes 8x8), causing a shape mismatch with the styler. Keeping the 2D mask preserves the full table shape across all historical diagonals. |
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 bb4dba2. Configure here.
| assert len(styled) == 8 | ||
|
|
||
|
|
||
| def test_highlight_diagonal_valuation_date_alias(raa) -> None: |
| if not isinstance(mask, Triangle): | ||
| raise TypeError("mask must be a Triangle instance.") | ||
|
|
||
| if self._triangle.is_val_tri or mask.is_val_tri: |
There was a problem hiding this comment.
this should be checked at the individual styler level only. many masks will work fine (like origin) on a val tri
| @@ -1,8 +1,9 @@ | |||
| { | |||
There was a problem hiding this comment.
can you add an example for apple_from_triangle?

Summary of Changes
highlight_diagonalto the Triangle styler to highlight the latest diagonal by default or any specific valuation date.apply_from_triangleto generalize mask-based styling across builtins.Related GitHub Issue(s)
Closes #1334
AI/LLM Usage
Used AI assistance for drafting unit tests and ruff checks.
Additional Context for Reviewers
Follows the pattern from
highlight_lower_triangleand supports chaining both methods. Both builtins now route throughapply_from_triangleSubmitter's Checklist
[FIX],[FEAT],[DOCS],[TST],[CHORE], or[BRK]).Reviewer's Checklist
Note
Low Risk
Presentation-layer API additions and a refactor of existing highlight logic; no auth, persistence, or numerical core changes.
Overview
Adds triangle-aware styling on
Styler: newapply_from_trianglestyles cells where a same-shaped maskTriangleis non-missing/truthy (with validation for valuation/multi-D triangles and sparse backends), and newhighlight_diagonalhighlights the latest or a chosen valuation diagonal (valuation/valuation_datealias,color/text_color/props).Refactors
highlight_lower_triangleto build a mask triangle and route throughapply_from_triangleinstead of inliningStyler.apply. Tests cover defaults, date formats, full triangles, chaining with lower-triangle highlight, and errors; docs add a “Highlighting diagonals” section in the style user guide.Reviewed by Cursor Bugbot for commit 3509d9b. Bugbot is set up for automated code reviews on this repo. Configure here.