[FIX] Manifold Learning: handling numpy LinAlgError#2228
[FIX] Manifold Learning: handling numpy LinAlgError#2228janezd merged 1 commit intobiolab:masterfrom jerneju:linalg-manifoldlearning
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2228 +/- ##
==========================================
+ Coverage 72.26% 72.28% +0.01%
==========================================
Files 318 318
Lines 54856 54867 +11
==========================================
+ Hits 39644 39658 +14
+ Misses 15212 15209 -3Continue to review full report at Codecov.
|
| else: | ||
| self.Error.manifold_error(e.args[0]) | ||
| except np.linalg.linalg.LinAlgError as e: | ||
| self.Error.manifold_error(e.args[0]) |
There was a problem hiding this comment.
Use str(e) instead of e.args[0].
Calling str() on an instance of BaseException will give something at least as good as `e.args[0].
Actually, even self.Error.manifold_error(e) but I'd prefer being explicit.
| def test_data_which_makes_singular(self): | ||
| """ | ||
| Sometimes singular matrix is calculated from input data and | ||
| that should be handled. |
There was a problem hiding this comment.
Rephrase: Handle singular matrices
| self.widget.apply_button.button.click() | ||
| self.assertFalse(self.widget.Error.sparse_not_supported.is_shown()) | ||
|
|
||
| def test_data_which_makes_singular(self): |
There was a problem hiding this comment.
test_singular_matrices or something like that?
| list(zip( | ||
| [1, 1, 1], | ||
| [0, 1, 2], | ||
| [0, 1, 1])) |
There was a problem hiding this comment.
Would a simpler, more obviously singular matrix, like all zeros, work here as well?
There was a problem hiding this comment.
Yes, matrix with all zeros would work here as well. But I just wanted to point out that regular matrix can crash the code as well.
Issue
https://sentry.io/biolab/orange3/issues/210202559/
Description of changes
Sometimes singular matrix is calculated from input data and that is now handled.
Includes