Skip to content

[CHORE] Ruff + Test Fixtures for Tail tests - #1374

Merged
henrydingliu merged 5 commits into
casact:mainfrom
henrydingliu:chore/yet_more_ruff
Sep 17, 2026
Merged

henrydingliu merged 5 commits into
casact:mainfrom
henrydingliu:chore/yet_more_ruff

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary of Changes

ruff fixes
adding tail_sample as a test fixture
adding a test for TailClark to cover application of truncation_age

Related GitHub Issue(s)

#1355
#1361
#1277

AI/LLM Usage

Used linter (not AI)

Additional Context for Reviewers

Submitter's Checklist

  • I have reviewed and am adhering to the standards outlined in the project Governing Doc.
  • The PR subject title summarizes the changes, with one proper prefix ([FIX], [FEAT], [DOCS], [TST], [CHORE], or [BRK]).
  • I am a human (not a bot), and this PR form is written by a human.

Reviewer's Checklist

  • The implementation addresses the associated issue(s).
  • The implementation is appropriate, maintainable, and follows ARCHITECTURE.md.
  • PR subject title has the proper prefix and the subject is appropriate.
  • Relevant issue(s) are linked.
  • AI/LLM usage is disclosed and appropriate.
  • Documentation and tests are appropriate.
  • CI tests passed, or any failures are acceptable.
  • Leave a comment with the final recommendation (e.g. approve as is, request a secondary review, or flag an area for more review).

Note

Low Risk
Formatting and test-only changes; tail estimator behavior is unchanged aside from clearer concatenate kwargs.

Overview
Applies Ruff-driven cleanup across the chainladder/tails package: module/class/method docstrings are reformatted to the multi-line style, and several calls (notably xp.concatenate in TailClark) use explicit axis=-1 and expanded line breaks without changing tail logic.

Test infrastructure adds a shared tail_sample pytest fixture (with the same normal_run / sparse_only_run parametrization as other samples) and refactors Bondy, curve, and constant tail tests to use fixtures plus TYPE_CHECKING annotations instead of inline load_sample. A new test_truncation_age asserts that a very large truncation_age on TailClark matches omitting truncation on the final CDF.

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

@github-actions

github-actions Bot commented Sep 17, 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.0% of exported symbols fully typed (208 / 1383)

Known Ambiguous Unknown Total
Project (head) 208 111 1064 1383

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: 327
  • 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.tails.tests.test_clark.test_truncation_age ❌ unknown new

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (01bf6bf) to head (c7433f0).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1374      +/-   ##
==========================================
+ Coverage   91.78%   91.86%   +0.08%     
==========================================
  Files          96       97       +1     
  Lines        5488     5496       +8     
  Branches      707      707              
==========================================
+ Hits         5037     5049      +12     
+ Misses        327      325       -2     
+ Partials      124      122       -2     
Flag Coverage Δ
unittests 91.86% <100.00%> (+0.08%) ⬆️

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 69c96d6. Configure here.

Comment thread chainladder/tails/tests/test_clark.py
@henrydingliu
henrydingliu marked this pull request as ready for review September 17, 2026 02:28
@henrydingliu henrydingliu changed the title [CHORE] Ruff + Test Fixtures for Tail fails [CHORE] Ruff + Test Fixtures for Tail tests Sep 17, 2026
@henrydingliu
henrydingliu merged commit 98f822a into casact:main Sep 17, 2026
13 checks passed
@henrydingliu
henrydingliu deleted the chore/yet_more_ruff branch September 17, 2026 22:10
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