Skip to content

sync#891

Merged
henrydingliu merged 30 commits into
experimentalfrom
main_copy
May 31, 2026
Merged

sync#891
henrydingliu merged 30 commits into
experimentalfrom
main_copy

Conversation

@henrydingliu
Copy link
Copy Markdown
Collaborator

@henrydingliu henrydingliu commented May 31, 2026

Summary of Changes

Related GitHub Issue(s)

Additional Context for Reviewers

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Medium Risk
Options API changes (removed DT64 options and deprecated helpers) could break callers still using old names; core valuation paths now depend on module-level datetime constants.

Overview
This PR refactors package configuration and expands documentation across the library and docs site.

chainladder.options is reworked from class-level settings into an instance-based Options class with validation, per-option reset_option, and removal of deprecated array_backend / auto_sparse helpers. Datetime precision is no longer exposed as DT64_DTYPE / DT64_UNIT options; instead __dt64_dtype__ and __dt64_unit__ are module-level constants used in triangle valuation, pandas aggregation, and date_delta_adjustment for Pandas 2/3 compatibility.

Docstrings gain runnable examples and clearer parameter notes for Development, BootstrapODPSample, DevelopmentCorrelation, and ValuationCorrelation. Tests add coverage for options defaults/get/set/reset and refactor sample fixtures via a shared _sample_fixture that sets/restores ARRAY_BACKEND.

The docs add a contributor docs/README.md, a Friedland section (chapters 6–7 RST, chapter 8 notebook, TOC entry), and a minor pyproject.toml formatting tweak. CODEOWNERS is a newline-only change.

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

kennethshsu and others added 29 commits May 22, 2026 14:24
Adds Sphinx doctest Examples sections to DevelopmentCorrelation and ValuationCorrelation. Each example opens with the Mack chain-ladder assumption being tested, prints the full decision signal (statistic, confidence band, and boolean) rather than a single boolean, and ties the result back to the chain-ladder workflow.

Refs #704
Adds Sphinx doctest Examples section to the BootstrapODPSample class showing basic fit (resampled_triangles_.shape and scale_), downstream stochastic IBNR via Chainladder, and the effect of drop_high on scale_. Uses random_state=42 and n_sims=100 for deterministic, fast output.

Refs #704
Rewords the paragraph introducing the drop_high=True example to describe it as a leave-one-out sensitivity check on the column maxima rather than outlier removal, since drop_high mechanically removes the column max without any outlier test.

Addresses review feedback on #836.
Per @henrydingliu review on #844: opening paragraph now scoped to the calendar-effect concept; the per-diagonal vs whole-triangle distinction is introduced as a transition between the two testcode blocks.

Refs #704
- Drop the jb build internals + duplicate warnings note (kennethshsu)
- Rename 'tutorial notebooks' to 'onboarding and Quickstart notebooks' (kennethshsu)
- Drop the 'What to edit for which part of the site' table and 'Known issues' section as redundant with the Source files table and #841 (kennethshsu)
docs: add README documenting docs build sources and outputs
Improved docstring and added examples for Development class
[REFACTOR]: Remove repetitive code. Remove dead Python 3.8 code. Add …
…option getters and setters. Deprecate cl.array_backend() and cl.auto_sparse()
first batch of deliverables for friedland reconstruction
[REFACTOR]: Continue work on cl.__init__.py refactor
@henrydingliu henrydingliu requested a review from jbogaardt as a code owner May 31, 2026 07:58
@henrydingliu henrydingliu marked this pull request as draft May 31, 2026 07:58
@henrydingliu henrydingliu marked this pull request as ready for review May 31, 2026 08:00
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 97.14286% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.30%. Comparing base (e76d85d) to head (caaff87).
⚠️ Report is 158 commits behind head on experimental.

Files with missing lines Patch % Lines
chainladder/__init__.py 96.42% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           experimental     #891      +/-   ##
================================================
+ Coverage         86.94%   87.30%   +0.36%     
================================================
  Files                86       86              
  Lines              4994     5114     +120     
  Branches            644      683      +39     
================================================
+ Hits               4342     4465     +123     
+ Misses              462      458       -4     
- Partials            190      191       +1     
Flag Coverage Δ
unittests 87.30% <97.14%> (+0.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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 merged commit 3979da4 into experimental May 31, 2026
17 checks 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.

4 participants