Skip to content

Commit

Permalink
Feature Statistics: Annotate settings, fix migration, improve summary…
Browse files Browse the repository at this point in the history
… code
  • Loading branch information
janezd committed Dec 4, 2020
1 parent 63dc54f commit 75489ff
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Orange/widgets/data/owfeaturestatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,11 +708,11 @@ class Outputs:
settings_version = 2

auto_commit = Setting(True)
color_var = ContextSetting(None) # type: Optional[Variable]
color_var: Optional[Variable] = ContextSetting(None)
# filter_string = ContextSetting('')

sorting = Setting((0, Qt.DescendingOrder))
selected_vars = ContextSetting([], schema_only=True)
sorting: Tuple[int, int] = Setting((0, Qt.DescendingOrder))
selected_vars: List[Variable] = ContextSetting([], schema_only=True)

def __init__(self):
super().__init__()
Expand Down Expand Up @@ -852,8 +852,9 @@ def commit(self):

# Send a table with only selected columns to output
variables = self.selected_vars
self.info.set_output_summary(len(self.data[:, variables]),
format_summary_details(self.data[:, variables]))
reduced_data = self.data[:, variables]
self.info.set_output_summary(len(reduced_data),
format_summary_details(reduced_data))
self.Outputs.reduced_data.send(self.data[:, variables])

# Send the statistics of the selected variables to ouput
Expand Down Expand Up @@ -888,7 +889,7 @@ def migrate_context(cls, context, version):
# is no suitable conversion function, and StringVariable (3)
# was the only hidden var when settings_version < 2, so:
if tpe != 3]
selected_vars = [all_vars[i] for i in selected_rows]
selected_vars = [all_vars[i] for i in selected_rows[0]]
context.values["selected_vars"] = selected_vars, -3


Expand Down

0 comments on commit 75489ff

Please sign in to comment.