Skip to content

[FIX] Apply Ruff fixes to core files. - #1287

Merged
genedan merged 1 commit into
mainfrom
gd_ruff_fix
Sep 4, 2026
Merged

[FIX] Apply Ruff fixes to core files.#1287
genedan merged 1 commit into
mainfrom
gd_ruff_fix

Conversation

@genedan

@genedan genedan commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary of Changes

Mostly mundane formatting with the exception of one variable name change (see #1285). I left display untouched as that will be addressed in #1284 and an rtest file that needs further debugging.

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 formatting and clearer naming in correlation helpers; no intended algorithm or slicing behavior changes.

Overview
Applies Ruff lint/format cleanup across chainladder/core/correlation.py, slice.py, and related core tests, and drops the corresponding per-file ignores in pyproject.toml now that those files pass the rules.

The only non-cosmetic code changes are in Mack correlation code: the development-period count variable In_dev_periods (with a Mack-97 comment), and the inner helper pZlowerp_z_lower. Formulas and call sites are updated to use the new names; behavior should be unchanged.

Tests are adjusted for style (e.g. raa.__eq__(None) instead of == None for Ruff) and test_grain.py drops unused imports.

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

@github-actions

github-actions Bot commented Sep 4, 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 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.82609% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.68%. Comparing base (670e86a) to head (025afa4).

Files with missing lines Patch % Lines
chainladder/core/slice.py 97.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1287      +/-   ##
==========================================
- Coverage   91.68%   91.68%   -0.01%     
==========================================
  Files          93       93              
  Lines        5447     5445       -2     
  Branches      704      704              
==========================================
- Hits         4994     4992       -2     
  Misses        328      328              
  Partials      125      125              
Flag Coverage Δ
unittests 91.68% <97.82%> (-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.

Comment thread chainladder/core/tests/test_arithmetic.py
Comment thread chainladder/core/correlation.py
@genedan
genedan merged commit 8a47051 into main Sep 4, 2026
24 checks passed
@genedan
genedan deleted the gd_ruff_fix branch September 4, 2026 18:43
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