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 19 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 / 20); 1 no longer exported
Patch symbol details
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1207 +/- ##
==========================================
+ Coverage 91.27% 91.31% +0.03%
==========================================
Files 91 91
Lines 5411 5434 +23
Branches 692 700 +8
==========================================
+ Hits 4939 4962 +23
+ Misses 338 336 -2
- Partials 134 136 +2
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 |
|
all core logic changes for the extra ruff edits in |
|
need to cover one more line to meet patch coverage |
…valuation triangle
…olumn_updates_is_ultimate
2de8840 to
8410299
Compare
|
friendly reminder to edit pyproject after you fix the ruff violations |
|
thanks removed per-file-ignores in pyproject.toml , (part of #1216) |
a410909 to
0b87279
Compare
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.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0b87279. Configure here.
|
@henrydingliu all CI checks and tests are passing. updated pyproject.toml as requested. |
|
looking at the time stamps, codecov patch starts after unittest is done. the same new lines for checking missing columns show as uncovered in both patch and project. in any case, 90% diff hit is sufficient for merging. i can approve once conflict is resolved. |

Summary of Changes
completes
Triangle.drop()functionality for Add parameters to Triangle.drop() #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).Resolved all Ruff lint violations in
pandas.pyandtest_triangle.pyand removed both files from ignore inpyproject.toml(part of Initial Linting Cleanup #1216).Related GitHub Issue(s)
closes #1057 #1062 #1061
part of #1052
part of #1216
Additional Context for Reviewers
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/drop semantics on origin and development axes and valuation metadata; behavior is well covered by new tests but affects user-facing data shape logic.
Overview
Triangle.drop()now supports dropping development periods viadevelopment=,axis=3, oraxis='development', with the same first/last-only rule as origin (interior drops raiseValueError). Missing labels honor a newerrorsparameter ('raise'vs'ignore');levelis accepted for API parity but only allowed with the index axis (still unimplemented).Input validation is tighter: calling
drop()with no labels/axis keywords raisesValueError, and columns/origin/development missing-label checks respecterrors. After development drops on valuation triangles,valuation_dateis updated; dropping the ultimate dev period clearsis_ultimate. Origin-drop dev trimming after NaN columns now uses NumPy dense paths instead of the backend array module.Docs/examples cover development dropping;
hvplotusesisinstanceforPeriodIndex. Ruff cleanups inpandas.pyandtest_triangle.pyplus removal of those files frompyproject.tomlper-file ignores; extensive new unit tests cover drop behavior.Reviewed by Cursor Bugbot for commit 8d05187. Bugbot is set up for automated code reviews on this repo. Configure here.