Skip to content

Commit

Permalink
Data info displayed in the status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
aturanjanin committed Mar 6, 2020
1 parent 4462394 commit b5a965e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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

0 comments on commit b5a965e

Please sign in to comment.