Skip to content

Commit ae61e97

Browse files
committed
owdiscretize: Fix common method inference in multi selection
(due to namedtuple comparison)
1 parent 9742951 commit ae61e97

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Orange/widgets/data/owdiscretize.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import Orange.preprocess.discretize as disc
1515

1616
from Orange.widgets import widget, gui, settings
17-
from Orange.widgets.utils import itemmodels, vartype
17+
from Orange.widgets.utils import itemmodels, vartype, unique_everseen
1818
from Orange.widgets.utils.widgetpreview import WidgetPreview
1919
from Orange.widgets.utils.state_summary import format_summary_details
2020
from Orange.widgets.widget import Input, Output
@@ -614,7 +614,14 @@ def _var_selection_changed(self, *_):
614614
self.copy_current_to_manual_button.setEnabled(
615615
len(indices) == 1 and not isinstance(methods[0], Custom)
616616
)
617-
mset = set(methods)
617+
618+
def key(method):
619+
if isinstance(method, Default):
620+
return Default, (None, )
621+
return type(method), tuple(method)
622+
623+
mset = list(unique_everseen(methods, key=key))
624+
618625
self.controlbox.setEnabled(len(mset) > 0)
619626
if len(mset) == 1:
620627
method = mset.pop()

0 commit comments

Comments
 (0)