Skip to content

refactor swapaxes to object#1084

Open
henrydingliu wants to merge 7 commits into
mainfrom
reduce_xp
Open

refactor swapaxes to object#1084
henrydingliu wants to merge 7 commits into
mainfrom
reduce_xp

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary of Changes

Changing all instance of xp.swapaxes(arr,...) to arr.swapaxes(...) , in order to reduce reliance on xp

Related GitHub Issue(s)

refers #1031

Additional Context for Reviewers

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Low Risk
Mechanical, behavior-equivalent refactor with no algorithm or API changes; risk is limited to backend parity if a non-NumPy/CuPy array module lacked .swapaxes.

Overview
Replaces xp.swapaxes(arr, …) with arr.swapaxes(…) across bootstrap ODP resampling, Clark/Munich development, standard Development regression params, Cape Cod apriori weighting, and WeightedRegression std_err_fill, so axis swaps go through the array API instead of the backend module (issue #1031).

A test helper in test_development.py is updated the same way; the only other diff there is a trailing newline at EOF.

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

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.43%. Comparing base (921bfca) to head (1851900).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1084      +/-   ##
==========================================
+ Coverage   89.75%   90.43%   +0.68%     
==========================================
  Files          91       91              
  Lines        5408     5564     +156     
  Branches      696      752      +56     
==========================================
+ Hits         4854     5032     +178     
+ Misses        389      375      -14     
+ Partials      165      157       -8     
Flag Coverage Δ
unittests 90.43% <100.00%> (+0.68%) ⬆️

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.

@github-actions

github-actions Bot commented Jul 2, 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.1% of exported symbols fully typed (175 / 1239)

Known Ambiguous Unknown Total
Project (head) 175 107 957 1239

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: 314
  • 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.

@henrydingliu henrydingliu marked this pull request as ready for review July 2, 2026 05:24
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