Skip to content

[FIX] Apply Ruff fix to chainladder/adjustments. - #1299

Open
genedan wants to merge 1 commit into
gd_ruff_fix_workflowfrom
gd_ruff_fix_adjustments
Open

[FIX] Apply Ruff fix to chainladder/adjustments.#1299
genedan wants to merge 1 commit into
gd_ruff_fix_workflowfrom
gd_ruff_fix_adjustments

Conversation

@genedan

@genedan genedan commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary of Changes

Stacked PR on top of #1290. Fixes files in chainladder/adjustments.

I commented out some lines per #1298. Also added an exception for the disposal rate array to keep it in triangle format (rather than one element per line).

Related GitHub Issue(s)

#1216

Additional Context for Reviewers

Checklist

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

Note

Low Risk
Mostly lint and formatting; the bootstrap exception narrowing and commented DOF block are small behavioral/documentation tweaks in bootstrap simulation code.

Overview
Brings chainladder/adjustments (and related tests) in line with the project Ruff rules and drops the per-file Ruff ignores for those paths in pyproject.toml.

In BootstrapODPSample, hat-matrix failure handling now catches np.linalg.LinAlgError instead of a bare except, and the unused degree-of-freedom adjustment block at the end of fit is commented out (per #1298). The rest of the module changes are formatting and small style fixes (e.g. is not for type checks).

disposal.py and the adjustment tests are mostly quote/format/docstring cleanup; test_disposal keeps the Friedland expected array in triangular layout via # fmt: off and explicit float literals so Ruff does not flatten the assertion data. trend.py drops an unused pandas import.

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

@github-actions

github-actions Bot commented Sep 5, 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): 15.4% of exported symbols fully typed (213 / 1381)

Known Ambiguous Unknown Total
Project (head) 213 110 1058 1381

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: 326
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): no exported symbol type-completeness changes detected.

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.65%. Comparing base (9577b40) to head (491ec61).

Files with missing lines Patch % Lines
chainladder/adjustments/bootstrap.py 77.77% 1 Missing and 1 partial ⚠️
chainladder/adjustments/disposal.py 90.90% 1 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           gd_ruff_fix_workflow    #1299      +/-   ##
========================================================
- Coverage                 91.66%   91.65%   -0.01%     
========================================================
  Files                        93       93              
  Lines                      5437     5431       -6     
  Branches                    704      704              
========================================================
- Hits                       4984     4978       -6     
  Misses                      328      328              
  Partials                    125      125              
Flag Coverage Δ
unittests 91.65% <85.00%> (-0.01%) ⬇️

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