feat(core): allow Triangle.drop() development dropping, label validation, and error options - #1207
feat(core): allow Triangle.drop() development dropping, label validation, and error options#1207priyam0k wants to merge 5 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): 0.0% fully typed (0 / 9); 1 no longer exported
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 23030c6. Configure here.
| "Only the first or last development periods may be dropped; " | ||
| "dropping an interior development period would leave a gap." | ||
| ) | ||
| result = result._slice(keep, "ddims") |
There was a problem hiding this comment.
Development drop skips valuation date
Medium Severity
Development drop() slices ddims through _slice and never refreshes valuation_date. On a valuation triangle, removing the latest period leaves valuation_date on a removed calendar date, so latest_diagonal and other valuation-date checks no longer match remaining cells.
Reviewed by Cursor Bugbot for commit 23030c6. Configure here.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1207 +/- ##
==========================================
+ Coverage 91.25% 91.46% +0.21%
==========================================
Files 91 91
Lines 5395 5577 +182
Branches 689 743 +54
==========================================
+ Hits 4923 5101 +178
- Misses 338 339 +1
- Partials 134 137 +3
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:
|
|
these reviews are gonna be challenging, with the mix of ruff debugging and actual code change. @genedan would love to get your take |


Summary of Changes
completes
Triangle.drop()functionality for #1052:development=,axis=3, oraxis='development'. requires dropping first/last periods to prevent gaps.labels=None. raisesValueErrorif no labels or axis keywords are passed.levelanderrorsparameters (errors='ignore'suppresses missing labelKeyErrors).Related GitHub Issue(s)
closes #1057 #1062 #1061
part of #1052
Additional Context for Reviewers
#1051 (index label dropping) remains
Checklist
uv run pytest) and documentation changes (uv run --directory docs jb build . --builder=custom --custom-builder=doctest)Note
Medium Risk
Changes core Triangle slicing/validation behavior; wrong edge cases could alter triangle shape, but rules mirror existing origin drops and are heavily tested.
Overview
Triangle.drop()now supports dropping development periods viadevelopment=,axis=3, oraxis='development', using the same first/last-only rule as origin (interior drops raiseValueError). Missing labels on columns, origin, and development honor a newerrorsargument ('raise'vs'ignore');levelis documented for API parity. Callingdrop()with no labels/axis keywords now raisesValueError, and column drops check for missing names before slicing.Docs gain a development-drop doctest;
NotImplementedErrortext now lists column, origin, and development (index still unimplemented).Minor cleanups:
isinstanceinstead oftype() ==inhvplotand tests; remove an unusedxpin groupby aggregation; test/style fixes (is_cumulativebooleans, expanded drop coverage).Reviewed by Cursor Bugbot for commit 23030c6. Bugbot is set up for automated code reviews on this repo. Configure here.