Skip to content

[FIX] Apply Ruff fix to chainladder/workflow. - #1297

Open
genedan wants to merge 1 commit into
gd_ruff_fix_tailsfrom
gd_ruff_fix_workflow
Open

[FIX] Apply Ruff fix to chainladder/workflow.#1297
genedan wants to merge 1 commit into
gd_ruff_fix_tailsfrom
gd_ruff_fix_workflow

Conversation

@genedan

@genedan genedan commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary of Changes

Stacked PR on #1290. One fix that may need explaining is turning callable_weight into a function. That comes from https://docs.astral.sh/ruff/rules/lambda-assignment/, which specifies that a lambda assigned to a variable is better off as a function.

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
Test and formatting-only changes with no production logic changes; lambda-to-function in tests is equivalent behavior.

Overview
Applies Ruff formatting and lint fixes across chainladder/workflow (voting.py and workflow tests) so those paths comply without per-file ignores in pyproject.toml.

The only behavioral-adjacent change is in tests: callable_weight is no longer a lambda assigned to a name (Ruff E731); it is a small named function with the same logic, still used in the parametrized weights fixture.

Everything else is style: double-quoted strings, trailing commas, type-hint spacing, docstring quote style, method-chain line breaks, comment/whitespace cleanup in _get_ultimate, and a final newline on voting.py. Ruff per-file-ignores for test_voting.py, test_workflow.py, and voting.py are removed now that the files are clean.

Reviewed by Cursor Bugbot for commit 9577b40. 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): 0.0% fully typed (0 / 1)

Known Ambiguous Unknown Total
Patch 0 0 1 1
Patch symbol details
Symbol Status Change
chainladder.workflow.tests.test_voting.callable_weight ❌ unknown changed (was ⚠️ ambiguous)

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.66%. Comparing base (e9a0dd8) to head (9577b40).

Additional details and impacted files
@@                Coverage Diff                 @@
##           gd_ruff_fix_tails    #1297   +/-   ##
==================================================
  Coverage              91.66%   91.66%           
==================================================
  Files                     93       93           
  Lines                   5436     5437    +1     
  Branches                 704      704           
==================================================
+ Hits                    4983     4984    +1     
  Misses                   328      328           
  Partials                 125      125           
Flag Coverage Δ
unittests 91.66% <100.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