Repository navigation
REF: Drop the unused cache of pinv(z) in the IV covariance - #874
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 11, 2026 17:38
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #870, which was merged before this commit reached its branch.
The IV covariance estimators cached
pinv(z)only to computepinv(z) @ x. The model always passespinv(z) @ xto them together withpinv(z), so the cachedpinv(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 computespinv(z) @ xdirectly when it is not given, and drops thepinvzargument of_reuse. Results are unchanged.The IV tests pass, and the reuse code in
covariance.pyhas full line and branch coverage. This does not conflict with #873.🤖 Generated with Claude Code