Skip to content

[FIX] Apply Ruff fix to chainladder/development. - #1294

Open
genedan wants to merge 2 commits into
gd_ruff_fix_plotsfrom
gd_ruff_fix_development
Open

[FIX] Apply Ruff fix to chainladder/development.#1294
genedan wants to merge 2 commits into
gd_ruff_fix_plotsfrom
gd_ruff_fix_development

Conversation

@genedan

@genedan genedan commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary of Changes

Stacked pull request on #1290. Ruff cleanup of chainladder/development 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
Lint and formatting only in development estimators and tests; Munich renames are private methods with no reserving logic changes.

Overview
This PR Ruff-cleans the chainladder/development package and its unit tests so those modules meet the repo lint rules without per-file ignores.

Production code changes are almost entirely formatting and style: wrapped signatures, normalized quotes/spacing, docstring tweaks, removed unused imports (numpy in glm.py, unused Development/pandas in incremental.py, unused sklearn preprocessors in learning.py), and small idiomatic fixes such as not X.is_cumulative and weighted_step is None in DevelopmentML. Clark growth helpers _G / G_ keep their names with # noqa: N802; Munich private helpers are renamed _get_MCL_*_get_mcl_* with call sites updated—no public API change.

Tests are reformatted similarly, with minor lint fixes (e.g. bare exceptexcept Exception, pytest B018 assignments to _, dropping an unused xerror variable).

pyproject.toml drops the Ruff per-file-ignores entries for the cleaned development modules and tests, so those paths are now held to the full rule set.

Reviewed by Cursor Bugbot for commit c55a03a. 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): 14.9% of exported symbols fully typed (204 / 1369)

Known Ambiguous Unknown Total
Project (head) 204 111 1054 1369

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 88.88889% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.69%. Comparing base (7bd6da7) to head (c55a03a).

Files with missing lines Patch % Lines
chainladder/development/barnzehn.py 60.00% 3 Missing and 1 partial ⚠️
chainladder/development/learning.py 91.17% 2 Missing and 1 partial ⚠️
chainladder/development/incremental.py 90.00% 0 Missing and 1 partial ⚠️
chainladder/development/tests/test_development.py 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           gd_ruff_fix_plots    #1294      +/-   ##
=====================================================
- Coverage              91.69%   91.69%   -0.01%     
=====================================================
  Files                     96       96              
  Lines                   5456     5453       -3     
  Branches                 702      702              
=====================================================
- Hits                    5003     5000       -3     
  Misses                   328      328              
  Partials                 125      125              
Flag Coverage Δ
unittests 91.69% <88.88%> (-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