Document creating triangles with preexisting ultimates#968
Conversation
On every push to main, GitHub Actions automatically merges main into docs/great-docs-prototype so the docs branch stays current with all code changes while keeping its doc-engine files intact.
Add Triangle constructor examples and expand _split_ult docstring for round-trip and direct import via options.ULT_VAL. Add test_create_triangle_with_ultimates. Closes casact#523. Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #968 +/- ##
==========================================
+ Coverage 86.13% 88.96% +2.82%
==========================================
Files 86 89 +3
Lines 4941 5091 +150
Branches 643 655 +12
==========================================
+ Hits 4256 4529 +273
+ Misses 486 416 -70
+ Partials 199 146 -53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| @@ -0,0 +1,25 @@ | |||
| name: Sync main to docs/great-docs-prototype | |||
There was a problem hiding this comment.
Was this file committed accidentally? In any case, your personal fork should have the code to take changes from main, instead of putting this workflow on chainladder's main.
|
|
||
| .. testoutput:: | ||
|
|
||
| True |
There was a problem hiding this comment.
Can you also print the ultimate triangle for the testouput?
|
|
||
| .. testoutput:: | ||
|
|
||
| True |
There was a problem hiding this comment.
Same critique here - print the ultimate triangle for the testouput.
Summary
options.ULT_VALin theTriangleclass docstring, with round-trip and direct-import examples_split_ultdocstring to explain sentinel-date detection and the intended round-trip use casetest_create_triangle_with_ultimatescovering both patternsCloses #523
Test plan
pytest chainladder/core/tests/test_triangle.py::test_create_triangle_with_ultimatespytest chainladder/core/tests/test_triangle.py::test_create_full_triangleNote
Low Risk
Documentation and regression tests only; triangle construction logic is unchanged aside from docstrings. The new workflow only pushes merges to a docs branch.
Overview
Documents how to build ultimate triangles using the sentinel valuation
options.ULT_VAL: round-trip from reserving output viato_frame(keepdims=True)withdevelopment='valuation', or direct long-format import with valuation set to that date. TheTriangleclass docstring gains a new section with doctest examples;_split_ult’s docstring now describes sentinel detection and merge behavior (implementation unchanged).Adds
test_create_triangle_with_ultimatesfor round-trip equality withChainladder().ultimate_and for direct DataFrame construction withis_ultimate.Also adds a GitHub Action that merges
mainintodocs/great-docs-prototypeon every push tomain.Reviewed by Cursor Bugbot for commit 992622e. Bugbot is set up for automated code reviews on this repo. Configure here.