Skip to content

Document creating triangles with preexisting ultimates#968

Open
EKtheSage wants to merge 2 commits into
casact:mainfrom
EKtheSage:enh/523-triangle-ultimates-example
Open

Document creating triangles with preexisting ultimates#968
EKtheSage wants to merge 2 commits into
casact:mainfrom
EKtheSage:enh/523-triangle-ultimates-example

Conversation

@EKtheSage

@EKtheSage EKtheSage commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Document how to create triangles with preexisting ultimates via options.ULT_VAL in the Triangle class docstring, with round-trip and direct-import examples
  • Expand the _split_ult docstring to explain sentinel-date detection and the intended round-trip use case
  • Add test_create_triangle_with_ultimates covering both patterns

Closes #523

Test plan

  • pytest chainladder/core/tests/test_triangle.py::test_create_triangle_with_ultimates
  • pytest chainladder/core/tests/test_triangle.py::test_create_full_triangle

Note

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 via to_frame(keepdims=True) with development='valuation', or direct long-format import with valuation set to that date. The Triangle class 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_ultimates for round-trip equality with Chainladder().ultimate_ and for direct DataFrame construction with is_ultimate.

Also adds a GitHub Action that merges main into docs/great-docs-prototype on every push to main.

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

EKtheSage and others added 2 commits May 14, 2026 00:20
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

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.96%. Comparing base (5c1fc23) to head (992622e).
⚠️ Report is 308 commits behind head on main.

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     
Flag Coverage Δ
unittests 88.96% <100.00%> (+2.82%) ⬆️

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.

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 example for creating a triangle with preexisting ultimates

1 participant