Skip to content

[DOCS] Say which link ratios drop_valuation drops - #1630

Merged
henrydingliu merged 2 commits into
casact:mainfrom
scks1:#1590-drop_valuation_docs
Nov 16, 2026
Merged

henrydingliu merged 2 commits into
casact:mainfrom
scks1:#1590-drop_valuation_docs

Conversation

@scks1

@scks1 scks1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary of Changes

The Development docstring says drop_valuation removes the "entire valuation diagonal in the triangle". It removes the link ratios whose starting value has that valuation, the valuation link_ratio shows. So drop_valuation="1990" on raa leaves ldf_ unchanged, and "1989" drops the last link ratio of every origin, including the only 108-120 ratio. jbogaardt explained this keying in #168, and #563, which closed #457, kept it while fixing the grain used for quarterly triangles. Only the docs disagree with it.

This PR changes documentation only:

  • The drop_valuation parameter text says which link ratios it drops and gives the rule for an event: to leave out a change between valuations t-1 and t, pass t-1.
  • Step 3 of the order of drop operations now reads "remove the link ratios that start on the given valuations."
  • A raa example in the docstring prints the link_ratio table after drop_valuation="1986", with the six link ratios that start on the 1986 valuation gone.
  • The development tutorial's "omit the entire diagonal" sentence gets the same correction.

Related GitHub Issue(s)

Related to #168 (closed, where the keying was explained), #457 (closed by #563, which fixed the quarterly grain and kept the keying) and #1590 (which link_ratio cells a fit keeps). This does not close #1590.

AI/LLM Usage

I used Árbol, an AI assistant running on Muse, under my direction to check the behaviour, write the change and draft this description. I reviewed the change and the results.

Additional Context for Reviewers

  • The new docstring example runs under sphinx.ext.doctest with numpydoc on this branch: 10 tests, 0 failures (9 before this change).
  • chainladder/development/tests/test_development.py: 74 passed.
  • Only docstrings and one notebook markdown cell change, so no code path changes.

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).

drop_valuation removes the link ratios whose starting value has the
given valuation, as in link_ratio, not an entire diagonal. Reword the
parameter and step 3 of the drop order, add a raa example, and fix the
matching sentence in the development tutorial (casact#168, casact#457).

Developed with an AI assistant (Árbol, running Muse).
@github-actions

github-actions Bot commented Nov 16, 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): 18.1% of exported symbols fully typed (301 / 1666)

Known Ambiguous Unknown Total
Project (head) 301 96 1269 1666

Other symbols referenced but not exported by chainladder: 24

Known Ambiguous Unknown Total
Other (head) 11 1 12 24

Symbols without documentation:

  • Functions without docstring: 330
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): no exported symbol type-completeness changes detected.

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.94%. Comparing base (f3f1803) to head (63bc801).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1630   +/-   ##
=======================================
  Coverage   94.94%   94.94%           
=======================================
  Files          99       99           
  Lines        6427     6427           
  Branches      811      811           
=======================================
  Hits         6102     6102           
  Misses        207      207           
  Partials      118      118           
Flag Coverage Δ
unittests 94.94% <ø> (ø)

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

one quick nitpick

Comment thread chainladder/development/development.py Outdated

raa = cl.load_sample("raa")
base = cl.Development().fit(raa).ldf_
latest = cl.Development(drop_valuation="1990").fit(raa).ldf_

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it would be more clear if you dropped a valuation in the middle, like 1986

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the ldf_ comparison isn't needed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 63bc801. The example now drops 1986 and prints link_ratio, so one diagonal of six ratios is missing, and the ldf_ comparison is gone.

(This comment was written with Árbol, an AI assistant, under my direction.)

Drop a valuation in the middle of raa so the link_ratio table shows one
missing diagonal, and remove the ldf_ comparison, as asked in review.

Developed with an AI assistant (Árbol, running Muse).
@henrydingliu
henrydingliu merged commit b2537a8 into casact:main Nov 16, 2026
11 checks passed
@scks1
scks1 deleted the #1590-drop_valuation_docs branch November 16, 2026 04:09
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.

[FEAT] Document Development.w_ and show why each link ratio is in or out of ldf_ How to correctly apply drop_valuation to quarterly triangles?

2 participants