[FIX] KMeans: should not crash when there is less data rows than k#2172
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2172 +/- ##
=========================================
+ Coverage 71.44% 71.6% +0.16%
=========================================
Files 268 318 +50
Lines 53093 54527 +1434
=========================================
+ Hits 37932 39045 +1113
- Misses 15161 15482 +321Continue to review full report at Codecov.
|
janezd
left a comment
There was a problem hiding this comment.
This PR breaks the widget. Just open it, enable optimization, and decrease To. The number of rows in the table doesn't change.
The problem is that return in line 217 should also be changed to return True.
As a punishment :), add a test that check this (e.g. a tests that currently fails if the user does what I described above) before fixing this problem. :)
| self.run_optimization() | ||
| self.mainArea.show() | ||
| self.update_results() | ||
| if self.run_optimization(): |
There was a problem hiding this comment.
Say that mainArea is hidden. If optimization fails, main area won't be shown and updated. This is OK.
What if mainArea is currently shown and contains some data? If optimization fails, it won't be hidden, but it won't update either...
Issue
When there is less rows in a data than selected (from - to, second option) the widget crashes.
https://sentry.io/biolab/orange3/issues/235248479/
Description of changes
Includes