Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1304 +/- ##
==========================================
+ Coverage 95.03% 95.40% +0.37%
==========================================
Files 100 100
Lines 6471 6688 +217
Branches 819 874 +55
==========================================
+ Hits 6150 6381 +231
+ Misses 203 186 -17
- Partials 118 121 +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:
|
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): 7.4% fully typed (2 / 27); 2 no longer exported
Patch symbol details
|
7bcf3d0 to
0c87d2e
Compare
a9f5c57 to
c6e0c8d
Compare
7d7efdc to
4253b6e
Compare
4253b6e to
8b192f3
Compare
Noticed that here too. Switched back to the old preview using the sort toggle at the top of the timeline. The PR is rebased on main, conflict-free, and ready for another look.
Tested your branch against the suite. The 5 test failures come from dev_to_val returning Period objects instead of formatted string labels (like 2003Q4) and synthetic period_range under concat ignore_index. Adopted the setter pattern from your sketch: added TriangleAxis.set_unchecked and check=False across _set_axis, _set_origin, and _set_development. Slicing (_LocBase, TriangleSlicer._slice) and dunders (_prep_origin_development) now route through axis descriptors rather than raw _axes mutations, without altering public return types. The test suite passes cleanly.
Making triangle.index an Index/MultiIndex (#1537) and development an Index (#1538), along with returning PeriodIndex from dev_to_val (#1536), are breaking changes that belong in 1.0.0. PR #1304 completes the odims and ddims deprecation without breaking public contracts. Open to other ideas. |
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 fa0d1e1. Configure here.
|
@genedan this is ready for review, lot of back and forth here 😬 |
|
Just cleared the conflicts with main and pushed. We kept this strictly to wrapping up the odims/ddims deprecation and left the bigger Index refactor for 1.0. Getting this in now should prevent the recurring merge conflicts whenever other PRs land on main, but open to splitting it into bite-sized PRs if preferred. |

Summary of Changes
Triangle.__setstate__to migrate legacy pickled instances cleanly.Related GitHub Issue(s)
Closes #1012, closes #1013, closes #1053 , #1454, refs #601, refs #1216, refs #1466
Additional Context for Reviewers
Checklist
uv run pytest) and documentation changes (uv run --directory docs jb build . --builder=custom --custom-builder=doctest)Note
High Risk
This is a broad refactor of Triangle’s core axis model and touches arithmetic, slicing, pickle migration, and most estimators; regressions could surface as subtle misalignment of origin/development labels or broken legacy pickles.
Overview
This PR replaces direct
odims/ddimsusage withoriginanddevelopmentmanaged throughTriangleAxisdescriptors (axes 2 and 3), storing raw coordinates inTriangle._axesalongside index and columns. Getter/setter logic moves intochainladder.core.axis(_get_origin,_set_origin,_get_development,_set_development), with_set_axis/set_uncheckedso slicing, arithmetic broadcasting, and concat can widen axes without length checks.Triangle construction,
valuation,dev_to_val/val_to_dev,grain,sort_axis, slicing, and I/O now read and write the new APIs;__setstate__migrates legacy pickles that still carryodims/ddims(orkdims/vdims) into_axes. The development setter gains richer parsing (fractional lags, pattern labels, ultimate9999, valuation-period fallback), and several estimators (bootstrap, incremental, tails, etc.) reject valuation triangles viais_val_triinstead of inspecting internal dtype.Tests are expanded heavily for axis descriptors, edge cases, fractional ages, and pickle round-trips; call sites across core, development, methods, tails, and utils are updated to
origin/development(or_axes[2]/_axes[3]where internal).Reviewed by Cursor Bugbot for commit 54e1614. Bugbot is set up for automated code reviews on this repo. Configure here.