Docs/issue 704 tailconstant examples#722
Merged
kennethshsu merged 2 commits intocasact:mainfrom Apr 29, 2026
Merged
Conversation
Adds doctest-validated Examples block to the TailConstant class docstring covering tail, decay, and projection_period parameters. Follows the polars-style >>> doctest convention established in casact#714 and casact#719. All 9 example interactions pass strict doctest with byte-exact output matching.
…format (casact#704) - Switch from >>> doctest style to .. testsetup::/.. testcode::/.. testoutput:: per agreed convention in casact#704 / casact#713. - Move `import chainladder as cl` into testsetup block. - Update decay example to print ldf_ so the parameter's effect is observable. - Add an attachment_age example (parameter previously had no example). - Verified with sphinx-build -b doctest: 5 tests, 0 failures.
kennethshsu
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #704.
Adds API-reference examples to
TailConstantfollowing the.. testsetup::/.. testcode::/.. testoutput::conventionagreed on in #704 (and enabled by #713).
What's covered
tail_,cdf_).decay: shows how the parameter redistributes the tail acrossfuture periods (printed via
ldf_so the effect is visible).attachment_age: attaches the curve at an earlier development age.projection_period: extendscdf_beyond the latest dev age.Verification
Ran
sphinx-build -b doctestagainst the class — 5 tests, 0 failures.Notes
import chainladder as clis in.. testsetup::per the convention.>>>style examples that were not executableunder the new doctest workflow.
Note
Low Risk
Documentation-only change that adds executable doctest examples; no runtime logic is modified.
Overview
Adds an Examples section to
TailConstant’s docstring using the.. testsetup::/.. testcode::/.. testoutput::doctest format.The new examples cover basic constant tail usage plus demonstrations of
decay,attachment_age, andprojection_periodeffects ontail_,ldf_, andcdf_.Reviewed by Cursor Bugbot for commit 5396530. Bugbot is set up for automated code reviews on this repo. Configure here.