Skip to content

Fallback to gesvd in invert_subspace on failure - #381

Merged
larsevj merged 1 commit into
mainfrom
fallback_to_gesvd_in_svd_call
Aug 4, 2026
Merged

Fallback to gesvd in invert_subspace on failure#381
larsevj merged 1 commit into
mainfrom
fallback_to_gesvd_in_svd_call

Conversation

@larsevj

@larsevj larsevj commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI 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.

Pull request overview

Adds a robustness improvement to the ESMDA subspace inversion routine by retrying SVD with a more stable LAPACK driver when the default driver fails to converge, along with a regression test to ensure the fallback path behaves as intended.

Changes:

  • Add gesvd fallback and warning in invert_subspace when sp.linalg.svd raises LinAlgError (non-convergence).
  • Add a unit test that monkeypatches scipy.linalg.svd to force gesdd failure and verify fallback + warning + identical numerical result.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/iterative_ensemble_smoother/esmda_inversion.py Wraps SVD in try/except to warn and retry with lapack_driver="gesvd" on failure.
tests/test_esmda_inversion.py Adds a focused test to ensure the gesddgesvd fallback is exercised and produces the same result.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/iterative_ensemble_smoother/esmda_inversion.py

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/iterative_ensemble_smoother/esmda_inversion.py
@larsevj larsevj self-assigned this Aug 3, 2026
@larsevj larsevj added this to SCOUT Aug 3, 2026
@larsevj larsevj moved this to Ready for Review in SCOUT Aug 3, 2026

@andreas-el andreas-el 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.

Nice! 🍖

@github-project-automation github-project-automation Bot moved this from Ready for Review to Reviewed in SCOUT Aug 3, 2026
@larsevj
larsevj force-pushed the fallback_to_gesvd_in_svd_call branch from e48ab05 to cea6f9a Compare August 4, 2026 07:21
@larsevj
larsevj merged commit 5e9f10f into main Aug 4, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in SCOUT Aug 4, 2026
@larsevj
larsevj deleted the fallback_to_gesvd_in_svd_call branch August 4, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants