Skip to content

Docs/issue 704 tailconstant examples#722

Merged
kennethshsu merged 2 commits intocasact:mainfrom
priyam0k:docs/issue-704-tailconstant-examples
Apr 29, 2026
Merged

Docs/issue 704 tailconstant examples#722
kennethshsu merged 2 commits intocasact:mainfrom
priyam0k:docs/issue-704-tailconstant-examples

Conversation

@priyam0k
Copy link
Copy Markdown
Contributor

@priyam0k priyam0k commented Apr 26, 2026

Closes part of #704.

Adds API-reference examples to TailConstant following the
.. testsetup:: / .. testcode:: / .. testoutput:: convention
agreed on in #704 (and enabled by #713).

What's covered

  • Basic usage: applying a constant tail factor (tail_, cdf_).
  • decay: shows how the parameter redistributes the tail across
    future periods (printed via ldf_ so the effect is visible).
  • attachment_age: attaches the curve at an earlier development age.
  • projection_period: extends cdf_ beyond the latest dev age.

Verification

Ran sphinx-build -b doctest against the class — 5 tests, 0 failures.

Notes

  • import chainladder as cl is in .. testsetup:: per the convention.
  • Replaces the older >>> style examples that were not executable
    under 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, and projection_period effects on tail_, ldf_, and cdf_.

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

priyam0k and others added 2 commits April 26, 2026 13:20
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 kennethshsu merged commit a020797 into casact:main Apr 29, 2026
1 check 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.

2 participants