Skip to content

[FEAT]deprecate date dims - #1304

Open
priyam0k wants to merge 6 commits into
feature/deprecate-dimsfrom
feature/deprecate-date-dims
Open

priyam0k wants to merge 6 commits into
feature/deprecate-dimsfrom
feature/deprecate-date-dims

Conversation

@priyam0k

@priyam0k priyam0k commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Deprecate odims (Deprecate odims #1012) and ddims (Deprecate ddims #1013) on Triangle with FutureWarnings pointing to origin and development
  • Update internal usage across core modules, estimators, adjustments, and tails to prevent internal warnings
  • Preserve legacy pickle compatibility in Triangle.setstate so older saved instances unpickle cleanly
  • Add test coverage verifying deprecation warnings when reading or setting both attributes and unpickling legacy objects
  • Address ruff lint and formatting on touched files

Related GitHub Issue(s)

Closes #1012, closes #1013, refs #601, refs #1216

Additional Context for Reviewers

Checklist

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run --directory docs jb build . --builder=custom --custom-builder=doctest)

Note

Medium Risk
Wide refactor of origin/development axis handling touches core Triangle behavior and many estimators; legacy access still works but pickle migration and slicing/_slice axis naming changes could affect edge-case callers.

Overview
Deprecates direct use of Triangle.odims and Triangle.ddims in favor of the public origin and development APIs, while keeping backward compatibility.

Internal axis storage is renamed to _odims / _ddims across core triangle logic (slicing, arithmetic alignment, I/O, valuation math) and downstream estimators (development, methods, tails, bootstrap, concat). Library code now mutates the private fields so deprecation warnings are not triggered internally.

odims and ddims remain as compatibility properties that emit FutureWarning on get/set and delegate to the private arrays. Triangle.__setstate__ is extended to migrate pickles that still store odims/ddims (alongside existing kdims/vdims handling).

Tests are updated to assert on origin / development (or _odims / _ddims where appropriate), with new coverage for deprecation warnings and legacy unpickling.

Reviewed by Cursor Bugbot for commit 5668b6d. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.19355% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.07%. Comparing base (4df8368) to head (5668b6d).

Files with missing lines Patch % Lines
chainladder/development/munich.py 55.55% 4 Missing ⚠️
chainladder/adjustments/bootstrap.py 0.00% 0 Missing and 1 partial ⚠️
chainladder/development/incremental.py 50.00% 0 Missing and 1 partial ⚠️
chainladder/methods/base.py 66.66% 0 Missing and 1 partial ⚠️
chainladder/tails/constant.py 50.00% 1 Missing ⚠️
chainladder/tails/curve.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/deprecate-dims    #1304      +/-   ##
==========================================================
+ Coverage                   94.05%   94.07%   +0.01%     
==========================================================
  Files                          97       97              
  Lines                        5976     5996      +20     
  Branches                      776      778       +2     
==========================================================
+ Hits                         5621     5641      +20     
  Misses                        227      227              
  Partials                      128      128              
Flag Coverage Δ
unittests 94.07% <94.19%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Pyright Type Completeness

View the full pyright --verifytypes output for this commit

Project (full chainladder package, at this PR's head): 15.5% of exported symbols fully typed (230 / 1486)

Known Ambiguous Unknown Total
Project (head) 230 108 1148 1486

Other symbols referenced but not exported by chainladder: 13

Known Ambiguous Unknown Total
Other (head) 3 1 9 13

Symbols without documentation:

  • Functions without docstring: 327
  • Functions without default param: 0
  • Classes without docstring: 8

Patch (exported symbols added or changed by this PR): 0.0% fully typed (0 / 5)

Known Ambiguous Unknown Total
Patch 0 0 5 5
Patch symbol details
Symbol Status Change
chainladder.core.tests.test_triangle.test_ddims_deprecation_warning ❌ unknown new
chainladder.core.tests.test_triangle.test_odims_deprecation_warning ❌ unknown new
chainladder.core.triangle.Triangle.ddims ❌ unknown changed (was ✅ known)
chainladder.core.triangle.Triangle.odims ❌ unknown changed (was ✅ known)
chainladder.development.tests.test_constant.test_constant_incr_cumulative_none ❌ unknown new

@priyam0k
priyam0k changed the base branch from main to feature/deprecate-dims September 5, 2026 16:55
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch from 7bcf3d0 to 0c87d2e Compare September 5, 2026 20:10

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread chainladder/development/constant.py
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch from a9f5c57 to c6e0c8d Compare September 8, 2026 23:31
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch 4 times, most recently from 7d7efdc to 4253b6e Compare September 9, 2026 12:37
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch from 4253b6e to 8b192f3 Compare September 12, 2026 07:45

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread chainladder/core/triangle.py
@priyam0k
priyam0k marked this pull request as draft September 20, 2026 09:42
@priyam0k
priyam0k removed this pull request from stack #1305 September 29, 2026 21:58
@priyam0k
priyam0k changed the base branch from feature/deprecate-dims to feature/deprecate-kdims September 29, 2026 21:58
@priyam0k priyam0k changed the title Feature/deprecate date dims [FEAT]deprecate date dims Sep 29, 2026
@priyam0k
priyam0k added this pull request to stack #1437 September 29, 2026 21:59
@priyam0k
priyam0k marked this pull request as ready for review October 2, 2026 10:35
@priyam0k priyam0k mentioned this pull request Oct 2, 2026
3 of 11 tasks
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch from 648f416 to 5f1ec67 Compare October 2, 2026 23:07
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch from 5f1ec67 to 6f80d83 Compare October 3, 2026 06:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6f80d83. Configure here.

Comment thread chainladder/development/constant.py Outdated
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch 2 times, most recently from 1753fb1 to f9b73b4 Compare October 3, 2026 15:57
@priyam0k
priyam0k removed this pull request from stack #1437 October 3, 2026 16:54
@priyam0k
priyam0k changed the base branch from feature/deprecate-kdims to feature/deprecate-dims October 3, 2026 16:54
@priyam0k
priyam0k added this pull request to stack #1459 October 3, 2026 16:55
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch 3 times, most recently from 9952d4f to 1b2a7c9 Compare October 9, 2026 14:38
…1012, #1013)

- Encapsulate internal date dimensions into _odims and _ddims
- Provide backward-compatible odims and ddims properties emitting FutureWarning
- Migrate legacy pickled instances with odims/ddims in Triangle.__setstate__
- Decouple internal usages across core, estimators, tails, and tests
- Address ruff linting and formatting on touched files

Closes #1012, closes #1013, refs #1216, refs #601
@priyam0k
priyam0k force-pushed the feature/deprecate-date-dims branch from 1b2a7c9 to 5668b6d Compare October 11, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate ddims Deprecate odims

2 participants