File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Orange/widgets/unsupervised Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,7 @@ def _update_selection_variance_spin(self):
309309
310310 cut = numpy .searchsorted (self ._cumulative ,
311311 self .variance_covered / 100.0 ) + 1
312+ cut = min (cut , len (self ._cumulative ))
312313 self .ncomponents = cut
313314 if numpy .floor (self ._line .value ()) + 1 != cut :
314315 self ._line .setValue (cut - 1 )
Original file line number Diff line number Diff line change 1+ from Orange .data import Table
2+ from Orange .widgets .tests .base import WidgetTest
3+ from Orange .widgets .unsupervised .owpca import OWPCA
4+
5+
6+ class TestOWDistanceMatrix (WidgetTest ):
7+
8+ def setUp (self ):
9+ self .widget = self .create_widget (OWPCA )
10+
11+ def test_set_variance100 (self ):
12+ iris = Table ("iris" )[:5 ]
13+ self .widget .set_data (iris )
14+ self .widget .variance_covered = 100
15+ self .widget ._update_selection_variance_spin ()
You can’t perform that action at this time.
0 commit comments