Skip to content

Chapter 11 prep#1078

Merged
henrydingliu merged 46 commits into
experimentalfrom
chapter_11_prep
Jun 30, 2026
Merged

Chapter 11 prep#1078
henrydingliu merged 46 commits into
experimentalfrom
chapter_11_prep

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Related GitHub Issue(s)

Additional Context for Reviewers

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

Note

Medium Risk
Changes to nan_triangle (dropping the is_pattern shortcut) and full-triangle TriangleWeight logic can alter development/LDF and weighted fits; refreshed sample CSVs will change any test or doc that depended on the old rounded values.

Overview
Prepares Friedland textbook workflows (including upcoming Chapter 11) by refreshing bundled sample data and tightening triangle/weighting behavior.

Sample data and manifest: Friedland CSVs are updated with finer paid/reported amounts and new columns (e.g. Reported Claims on friedland_gl_insurer). The standalone friedland_xyz_disp dataset is removed from the manifest and deleted; disposal-style figures remain available via friedland_xyz_auto_bi. Friedland chapters 6–7 doctest outputs are adjusted to match the new numbers.

Triangle core: nan_triangle no longer treats pattern triangles as all-valid; only ultimate triangles still get a full mask. _drop_subtriangles also clears ndarray w_ weights so copies do not keep stale weight arrays.

TriangleWeight: n_periods weighting works on full triangles (e.g. full_triangle_) via X.is_full, using origin slicing instead of valuation filtering. Typing moves to TriangleProtocol; tests cover drop_valuation exhausting the triangle and parity between standard and full-triangle fits.

Weighted regression: Standard OLS uses explicit weighted means for slope/intercept and exposes rsq_ on the fitted model.

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

henrydingliu and others added 16 commits June 26, 2026 13:37
restructuring disposal attributes into mixin class
adding `is_disposal_rate` attribute to triangle
improving docstring and adding codecov coverage
* WIP

* making progress

* promoting _param_property

* fixing bug

* full implementation w/ test

* bugbot and tests

* test fix

* rubric

* docstring and additional tests

* bugbot proof

* Update test_disposal.py

* docstring and additional tests

* bugbot proof

* Update test_disposal.py

* more bugbot fixes

* bug fix

* fix

* forcing numpy after all

* more fixes

* more fixes

* addressing reviewer comments

* added missing dependencies

* restructuring disposal attributes into mixin class

* adding `is_disposal_rate` attribute to triangle

* improving docstring and adding codecov coverage

* chapter 11 prep

* streamlining single dev weights

* doctest fixes
@henrydingliu henrydingliu merged commit b3a5b13 into experimental Jun 30, 2026
16 checks passed
@github-actions

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): 14.1% of exported symbols fully typed (175 / 1242)

Known Ambiguous Unknown Total
Project (head) 175 107 960 1242

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: 314
  • Functions without default param: 0
  • Classes without docstring: 10

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

Known Ambiguous Unknown Total
Patch 0 0 3 3
Patch symbol details
Symbol Status Change
chainladder.utils.tests.test_utilities.test_triangleweight_drop_valuation_all ❌ unknown new
chainladder.utils.tests.test_utilities.test_triangleweight_full_triangle ❌ unknown new
chainladder.utils.weighted_regression.WeightedRegression.rsq_ ❌ unknown new

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.62%. Comparing base (921bfca) to head (d22d88d).
⚠️ Report is 3 commits behind head on experimental.

Additional details and impacted files
@@               Coverage Diff                @@
##           experimental    #1078      +/-   ##
================================================
- Coverage         89.75%   89.62%   -0.14%     
================================================
  Files                91       91              
  Lines              5408     5299     -109     
  Branches            696      673      -23     
================================================
- Hits               4854     4749     -105     
+ Misses              389      386       -3     
+ Partials            165      164       -1     
Flag Coverage Δ
unittests 89.62% <100.00%> (-0.14%) ⬇️

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.

@henrydingliu henrydingliu deleted the chapter_11_prep branch June 30, 2026 03:32
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.

1 participant