Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Orange/widgets/data/owdiscretize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from Orange.widgets import widget, gui, settings
from Orange.widgets.utils import itemmodels, vartype
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.utils.state_summary import format_summary_details
from Orange.widgets.widget import Input, Output

__all__ = ["OWDiscretize"]
Expand Down Expand Up @@ -260,7 +261,8 @@ def set_data(self, data):
self._restore(self.saved_var_states)
# Complete the induction of cut points
self._update_points()
self.info.set_input_summary(len(data))
self.info.set_input_summary(len(data),
format_summary_details(data))
else:
self.info.set_input_summary(self.info.NoInput)
self._clear()
Expand Down Expand Up @@ -483,9 +485,10 @@ def commit(self):
if self.data is not None and len(self.data):
domain = self.discretized_domain()
output = self.data.transform(domain)
self.info.set_output_summary(len(output))
else:
self.info.set_output_summary(self.info.NoOutput)

summary = len(output) if output else self.info.NoOutput
details = format_summary_details(output) if output else ""
self.info.set_output_summary(summary, details)
self.Outputs.data.send(output)

def storeSpecificSettings(self):
Expand Down
7 changes: 4 additions & 3 deletions Orange/widgets/data/tests/test_owdiscretize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from Orange.data import Table
from Orange.widgets.data.owdiscretize import OWDiscretize
from Orange.widgets.tests.base import WidgetTest
from orangewidget.widget import StateInfo
from Orange.widgets.utils.state_summary import format_summary_details


class TestOWDiscretize(WidgetTest):
Expand All @@ -28,9 +28,10 @@ def test_summary(self):

data = Table("iris")
self.send_signal(self.widget.Inputs.data, data)
input_sum.assert_called_with(int(StateInfo.format_number(len(data))))
input_sum.assert_called_with(len(data), format_summary_details(data))
output = self.get_output(self.widget.Outputs.data)
output_sum.assert_called_with(int(StateInfo.format_number(len(output))))
output_sum.assert_called_with(len(output),
format_summary_details(output))

input_sum.reset_mock()
output_sum.reset_mock()
Expand Down