Skip to content

[FIX] Apply Ruff fix to chainladder/tails. - #1296

Open
genedan wants to merge 1 commit into
gd_ruff_fix_methodsfrom
gd_ruff_fix_tails
Open

[FIX] Apply Ruff fix to chainladder/tails.#1296
genedan wants to merge 1 commit into
gd_ruff_fix_methodsfrom
gd_ruff_fix_tails

Conversation

@genedan

@genedan genedan commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary of Changes

Stacked PR on #1290. Fixes chainladder/tails files.

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
Formatting and lint-only edits to tail reserving code; no intended algorithm or API changes beyond equivalent type checks.

Overview
Applies Ruff lint and format cleanup across chainladder/tails/base.py, bondy.py, and curve.py so those modules meet the project rules without per-file ignores.

Changes are mostly mechanical: docstring/layout formatting, spacing around operators and dict literals, double-quoted strings, and wrapping long lines. TailBondy drops an unused DevelopmentBase import; TailCurve removes an unused num_to_nan import and replaces type(...) == slice with type(...) is slice for the deprecated fit_period slice path.

pyproject.toml removes the Ruff per-file-ignores entries for the three tail files now that they pass the selected rules.

Reviewed by Cursor Bugbot for commit e9a0dd8. 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 111 1057 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: 325
  • 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 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.66%. Comparing base (198832c) to head (e9a0dd8).

Files with missing lines Patch % Lines
chainladder/tails/curve.py 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                   Coverage Diff                   @@
##           gd_ruff_fix_methods    #1296      +/-   ##
=======================================================
- Coverage                91.66%   91.66%   -0.01%     
=======================================================
  Files                       93       93              
  Lines                     5437     5436       -1     
  Branches                   704      704              
=======================================================
- Hits                      4984     4983       -1     
  Misses                     328      328              
  Partials                   125      125              
Flag Coverage Δ
unittests 91.66% <82.35%> (-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