Skip to content

sync#1085

Merged
henrydingliu merged 17 commits into
experimentalfrom
main
Jul 2, 2026
Merged

sync#1085
henrydingliu merged 17 commits into
experimentalfrom
main

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

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

Low Risk
Changes are documentation, static typing, and tests with no intentional reserve-calculation behavior changes; dependency pin is a minor compatibility guard.

Overview
Adds ARCHITECTURE.md documenting package layout, the Triangle mixin stack, composition of indexers, and the TYPE_CHECKING + TriangleProtocol pattern for mixins without runtime Protocol MRO issues.

Typing: TrianglePandas now uses a conditional _TrianglePandasBase (TriangleProtocol under TYPE_CHECKING, object at runtime). TriangleProtocol gains axis setters, __round__, and stricter fillna typing; _auto_sparse() is annotated to return Triangle. The pandas-style API on TrianglePandas gets clearer return types and small cleanups (round delegates to __round__, pct_chg DataFrame passthrough, concat import at module level).

Tests: Broad new coverage for arithmetic unions/broadcasting, __array__ / __array_function__, auto-sparse behavior, polars __dataframe__ init, invalid origin/development rows, and related edge cases.

Deps: uv.lock caps pandas at <=3.0.3.

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

@henrydingliu henrydingliu merged commit 44d0119 into experimental Jul 2, 2026
26 checks passed
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Pyright Type Completeness

View the full pyright --verifytypes output for this commit

Project (full chainladder package, at this PR's head): 14.7% of exported symbols fully typed (184 / 1252)

Known Ambiguous Unknown Total
Project (head) 184 106 962 1252

Other symbols referenced but not exported by chainladder: 13

Known Ambiguous Unknown Total
Other (head) 3 1 9 13

Symbols without documentation:

  • Functions without docstring: 313
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): 39.1% fully typed (9 / 23); 3 no longer exported

Known Ambiguous Unknown Total
Patch 9 3 11 23
Patch symbol details
Symbol Status Change
chainladder.adjustments.disposal.DisposalRate.xp ⚠️ ambiguous changed (was ❌ unknown)
chainladder.core.pandas.TrianglePandas.T ✅ known changed (was ❌ unknown)
chainladder.core.pandas.TrianglePandas.columns ✅ known changed (was ❌ unknown)
chainladder.core.pandas.TrianglePandas.development ✅ known changed (was ❌ unknown)
chainladder.core.pandas.TrianglePandas.index ✅ known changed (was ⚠️ ambiguous)
chainladder.core.pandas.TrianglePandas.origin ✅ known changed (was ❌ unknown)
chainladder.core.pandas.TrianglePandas.to_frame ✅ known changed (was ❌ unknown)
chainladder.core.pandas.func ⚠️ ambiguous new
chainladder.core.pandas.method ⚠️ ambiguous new
chainladder.core.tests.test_arithmetic.test_arithmetic_union_val_tri ❌ unknown new
chainladder.core.tests.test_arithmetic.test_eq_non_triangle ❌ unknown new
chainladder.core.tests.test_arithmetic.test_non_overlapping_odims ❌ unknown new
chainladder.core.tests.test_arithmetic.test_origin_broadcasting ❌ unknown new
chainladder.core.tests.test_arithmetic.test_pow_groupby ❌ unknown new
chainladder.core.tests.test_triangle.test_array_dunder ❌ unknown new
chainladder.core.tests.test_triangle.test_array_function_mixed_types_raises ❌ unknown new
chainladder.core.tests.test_triangle.test_array_function_unhandled_raises ❌ unknown new
chainladder.core.tests.test_triangle.test_auto_sparse_converts_numpy_to_sparse ❌ unknown new
chainladder.core.tests.test_triangle.test_auto_sparse_disabled_returns_self ❌ unknown new
chainladder.core.tests.test_triangle.test_development_before_origin_warns_and_drops ✅ known new
chainladder.core.tests.test_triangle.test_subtriangles ❌ unknown new
chainladder.core.tests.test_triangle.test_triangle_from_dataframe_interchange_protocol ✅ known new
chainladder.core.typing.TriangleProtocol.__round__ ✅ known new
chainladder.core.pandas.item no longer exported (was ⚠️ ambiguous)
chainladder.core.pandas.k no longer exported (was ⚠️ ambiguous)
chainladder.core.pandas.v no longer exported (was ⚠️ ambiguous)

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.18%. Comparing base (921bfca) to head (55f9524).
⚠️ Report is 23 commits behind head on experimental.

Additional details and impacted files
@@               Coverage Diff                @@
##           experimental    #1085      +/-   ##
================================================
+ Coverage         89.75%   90.18%   +0.42%     
================================================
  Files                91       91              
  Lines              5408     5409       +1     
  Branches            696      696              
================================================
+ Hits               4854     4878      +24     
+ Misses              389      375      -14     
+ Partials            165      156       -9     
Flag Coverage Δ
unittests 90.18% <100.00%> (+0.42%) ⬆️

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.

2 participants