Skip to content

REF: Drop the unused cache of pinv(z) in the IV covariance - #874

Merged
bashtage merged 1 commit into
mainfrom
iv-drop-pinvz-cache
Nov 11, 2026
Merged

bashtage merged 1 commit into
mainfrom
iv-drop-pinvz-cache

Conversation

@bashtage

Copy link
Copy Markdown
Owner

Follow-up to #870, which was merged before this commit reached its branch.

The IV covariance estimators cached pinv(z) only to compute pinv(z) @ x. The model always passes pinv(z) @ x to them together with pinv(z), so the cached pinv(z) was never read, and the branch that returned it could not be reached. Codecov reported it as a partial branch on #870. This commit computes pinv(z) @ x directly when it is not given, and drops the pinvz argument of _reuse. Results are unchanged.

The IV tests pass, and the reuse code in covariance.py has full line and branch coverage. This does not conflict with #873.

🤖 Generated with Claude Code

pinv(z) was only read to compute pinv(z) @ x, and the model always passes
pinv(z) @ x together with pinv(z), so the cached pinv(z) was never used and
the branch that returns it could not be reached. Compute pinv(z) @ x
directly when it is not given.
@bashtage
bashtage marked this pull request as ready for review November 11, 2026 17:38
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.69%. Comparing base (5799ee0) to head (4523dbb).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #874   +/-   ##
=======================================
  Coverage   99.69%   99.69%           
=======================================
  Files         202      202           
  Lines       38797    38792    -5     
  Branches     2497     2496    -1     
=======================================
- Hits        38677    38673    -4     
  Misses         51       51           
+ Partials       69       68    -1     
Flag Coverage Δ
adder 99.68% <100.00%> (+<0.01%) ⬆️
subtractor 99.68% <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.

@bashtage
bashtage merged commit e32cb00 into main Nov 11, 2026
27 checks passed
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.

1 participant