Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] OWContinuize: Data info displayed in the status bar #4494

Merged
merged 1 commit into from
Mar 6, 2020
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
7 changes: 5 additions & 2 deletions Orange/widgets/data/owcontinuize.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from Orange.widgets.settings import Setting
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.utils.state_summary import format_summary_details
from Orange.widgets.widget import Input, Output


Expand Down Expand Up @@ -116,7 +117,8 @@ def setData(self, data):
self.info.set_output_summary(self.info.NoOutput)
self.Outputs.data.send(None)
else:
self.info.set_input_summary(len(data))
self.info.set_input_summary(len(data),
format_summary_details(data))
self.unconditional_commit()

def enable_normalization(self):
Expand Down Expand Up @@ -151,7 +153,8 @@ def commit(self):
domain = continuizer(self.data)
data = self.data.transform(domain)
self.Outputs.data.send(data)
self.info.set_output_summary(len(data))
self.info.set_output_summary(len(data),
format_summary_details(data))
else:
self.Outputs.data.send(self.data) # None or empty data

Expand Down
8 changes: 5 additions & 3 deletions Orange/widgets/data/tests/test_owcontinuize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from Orange.widgets.data import owcontinuize
from Orange.widgets.data.owcontinuize import OWContinuize
from Orange.widgets.tests.base import WidgetTest
from orangewidget.widget import StateInfo
from Orange.widgets.utils.state_summary import format_summary_details


class TestOWContinuize(WidgetTest):
Expand Down Expand Up @@ -48,9 +48,11 @@ def test_summary(self):
output_sum = self.widget.info.set_output_summary = Mock()

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