Skip to content

Conversation

@jthorton
Copy link
Contributor

@jthorton jthorton commented Jan 20, 2026

Description

Fixes #97 by padding calculated errors of exactally zero by some small amount.

Todos

Notable points that this PR has either accomplished or will accomplish.

  • TODO 1

Questions

  • Question1

Checklist

  • Added a news entry for new features, bug fixes, or other user facing changes.

Status

  • Ready to go

Tips

  • Comment "pre-commit.ci autofix" to have pre-commit.ci atomically format your PR.
    Since this will create a commit, it is best to make this comment when you are finished with your work.

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.67%. Comparing base (0899b64) to head (acb623b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #177      +/-   ##
==========================================
+ Coverage   95.64%   95.67%   +0.03%     
==========================================
  Files          18       18              
  Lines        1263     1273      +10     
==========================================
+ Hits         1208     1218      +10     
  Misses         55       55              

☔ View full report in Codecov by Sentry.
📢 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.

@jthorton
Copy link
Contributor Author

pre-commit.ci autofix

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Not 100% sure about the impact, but adding this padding should be ok?

Comment on lines +211 to +214
for i in range(N):
for j in range(N):
if i != j and df_ij[i, j] == 0.0:
df_ij[i, j] = 1e-6
Copy link
Member

Choose a reason for hiding this comment

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

How about something like df_ij[df_ij == 0.0] = 1e-6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I wasn't sure about replacing the absolute values on the diagonal as they are currently zero and it works but I guess there is no harm.

Copy link
Member

Choose a reason for hiding this comment

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

ah yeah that's fair! better keep the diagonals zero

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh no this causes the F_matrix to change see here where each row is multipiled by some large inverse weight. I'll revert for now.

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.

Error of exactly zero will trigger SVD failure when generating absolute values

3 participants