Skip to content

[FEAT] Fill method + Chapter 16 data - #1379

Merged
henrydingliu merged 5 commits into
casact:feature/fillfrom
henrydingliu:feature/friedland_chapter_16
Sep 17, 2026
Merged

henrydingliu merged 5 commits into
casact:feature/fillfrom
henrydingliu:feature/friedland_chapter_16

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary of Changes

Prep for Friedland Chapter 16

  • add Triangle.fill method, with tests
  • fix typos in data

Related GitHub Issue(s)

closes #1360

AI/LLM Usage

I used AI to find the incorrect data points and to debug

Additional Context for Reviewers

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

Low Risk
Small additive API with tests and sample-data fixes; no changes to reserving or auth paths.

Overview
Adds Triangle.fill, which sets every valid (non-masked) cell to a scalar while preserving the triangle’s NaN structure via nan_triangle. Default is copy-out; inplace=True mutates values in place using the active array backend.

Tests cover a sliced triangle and a chainladder full_triangle_.

friedland_autoprop.csv is corrected for Friedland Chapter 16 prep (paid/incurred typos on two 2001 origin rows).

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

@github-actions

github-actions Bot commented Sep 17, 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 / 1385)

Known Ambiguous Unknown Total
Project (head) 209 111 1065 1385

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 (1 / 3)

Known Ambiguous Unknown Total
Patch 1 0 2 3
Patch symbol details
Symbol Status Change
chainladder.core.tests.test_triangle.test_fill ❌ unknown new
chainladder.core.tests.test_triangle.test_full_fill ❌ unknown new
chainladder.core.triangle.Triangle.fill ✅ known new

@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 2 potential issues.

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 b5405bb. Configure here.

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

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.80%. Comparing base (01bf6bf) to head (40e843b).
⚠️ Report is 3 commits behind head on feature/fill.

Additional details and impacted files
@@               Coverage Diff                @@
##           feature/fill    #1379      +/-   ##
================================================
+ Coverage         91.78%   91.80%   +0.02%     
================================================
  Files                96       96              
  Lines              5488     5502      +14     
  Branches            707      708       +1     
================================================
+ Hits               5037     5051      +14     
  Misses              327      327              
  Partials            124      124              
Flag Coverage Δ
unittests 91.80% <100.00%> (+0.02%) ⬆️

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 marked this pull request as ready for review September 17, 2026 05:55
@kennethshsu

Copy link
Copy Markdown
Member

@henrydingliu can you work off a branch on casact so I can switch to it a bit easier?

Are we still doing the check if the triangle is full? I think it could be a useful hyper parameter. The current implementation checks for nans only? So while the lower half will be nan, nothing is filled, but if the upper half has a nan, it will stay as nan? Anyways I could be missing something as I am just staring at the code without being able to play with it.

@kennethshsu
kennethshsu marked this pull request as draft September 17, 2026 18:21
@kennethshsu kennethshsu self-assigned this Sep 17, 2026
@henrydingliu
henrydingliu changed the base branch from main to feature/fill September 17, 2026 18:47
@henrydingliu
henrydingliu marked this pull request as ready for review September 17, 2026 18:47
@henrydingliu
henrydingliu merged commit 493face into casact:feature/fill Sep 17, 2026
13 checks passed
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.

[ENH] Add dedicated functionality for filling a Triangle

2 participants