Skip to content

[FEAT] IncrementalAdditive Cleanup for Chapter 16 Part 1 - #1419

Open
henrydingliu wants to merge 11 commits into
casact:mainfrom
henrydingliu:feature/friedland_chapter_16_prep_2
Open

henrydingliu wants to merge 11 commits into
casact:mainfrom
henrydingliu:feature/friedland_chapter_16_prep_2

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Summary of Changes

More clean-up and bug fix as I work through Chapter 16

  • Cleaning up zeta_-related properties into IncrementalMixin, matching DisposalMixin
  • fixed a bug in cum_to_incr for cum_zeta_, w/ new test to guard future drift; also improved readability of the surrounding code
  • refactored _param_property across modules to condense the universal properties to DevelopmentBase and keep module-specific properties at module level
  • other docstring improvements

Related GitHub Issue(s)

#588
#377

AI/LLM Usage

AI did some autofill of docstrings, which I then validated edited

Additional Context for Reviewers

zeta_ still shows the wrong development labels. will address after #1304

Submitter's Checklist

  • I have reviewed and am adhering to the standards outlined in the project Governing Doc.
  • The PR subject title summarizes the changes, with one proper prefix ([FIX], [FEAT], [DOCS], [TST], [CHORE], or [BRK]).
  • I am a human (not a bot), and this PR form is written by a human.

Reviewer's Checklist

  • The implementation addresses the associated issue(s).
  • The implementation is appropriate, maintainable, and follows ARCHITECTURE.md.
  • PR subject title has the proper prefix and the subject is appropriate.
  • Relevant issue(s) are linked.
  • AI/LLM usage is disclosed and appropriate.
  • Documentation and tests are appropriate.
  • CI tests passed, or any failures are acceptable.
  • Leave a comment with the final recommendation (e.g. approve as is, request a secondary review, or flag an area for more review).

Note

Medium Risk
Touches core triangle cum/incr logic and how fitted parameters are stored and exposed; behavior changes for additive patterns are guarded by new tests but affect development workflows.

Overview
Introduces IncrementalMixin (mirroring DisposalMixin) so zeta_ / cum_zeta_ live on triangles and estimators with backing _zeta_, enforced pattern flags on set, and has_zeta keyed off _zeta_. cum_zeta_ is removed from common in favor of the mixin.

incr_to_cum / cum_to_incr on Triangle are refactored to branch explicitly on is_pattern, is_additive, and is_disposal_rate, fixing incorrect incremental conversion for additive zeta_ / cum_zeta_ (new is_additive property). DevelopmentBase._param_property only applies shared wrapping; Development, IncrementalAdditive, and disposal each override for module-specific values and flags.

Tests cover cum_zeta_ assignment and missing-zeta_ errors.

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

@github-actions

github-actions Bot commented Sep 21, 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.1% of exported symbols fully typed (209 / 1387)

Known Ambiguous Unknown Total
Project (head) 209 111 1067 1387

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: 10

Patch (exported symbols added or changed by this PR): 33.3% fully typed (2 / 6); 1 no longer exported

Known Ambiguous Unknown Total
Patch 2 0 4 6
Patch symbol details
Symbol Status Change
chainladder.core.triangle.Triangle.is_additive ✅ known new
chainladder.development.incremental.IncrementalMixin ❌ unknown new
chainladder.development.incremental.IncrementalMixin.cum_zeta_ ❌ unknown new
chainladder.development.incremental.IncrementalMixin.zeta_ ❌ unknown new
chainladder.development.tests.test_incremental.test_no_zeta ❌ unknown new
chainladder.development.tests.test_incremental.test_setting_cum ✅ known new
chainladder.core.common.Common.cum_zeta_ — no longer exported (was ❌ unknown)

@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
@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.36364% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.74%. Comparing base (d82c521) to head (d461b14).
⚠️ Report is 108 commits behind head on main.

Files with missing lines Patch % Lines
chainladder/core/triangle.py 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1419      +/-   ##
==========================================
+ Coverage   91.79%   92.74%   +0.95%     
==========================================
  Files          96      102       +6     
  Lines        5494     5967     +473     
  Branches      707      742      +35     
==========================================
+ Hits         5043     5534     +491     
+ Misses        327      312      -15     
+ Partials      124      121       -3     
Flag Coverage Δ
unittests 92.74% <96.36%> (+0.95%) ⬆️

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.

@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

@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 Outdated
@henrydingliu henrydingliu changed the title [FEAT] IncrementalAdditive Cleanup for Chapter 16 [FEAT] IncrementalAdditive Cleanup for Chapter 16 Part 1 Sep 21, 2026
@henrydingliu
henrydingliu marked this pull request as ready for review September 21, 2026 17:44

@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 1eae41e. Configure here.

Comment thread chainladder/core/triangle.py Outdated
@henrydingliu

Copy link
Copy Markdown
Member Author

@genedan just assigned this to you as i'd like this to land so i can continue working on chapter 16.

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.

2 participants