Skip to content

Fallback to gesvd in invert_subspace on failure#381

Open
larsevj wants to merge 1 commit into
mainfrom
fallback_to_gesvd_in_svd_call
Open

Fallback to gesvd in invert_subspace on failure#381
larsevj wants to merge 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
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