3434from Orange .widgets .settings import (Setting , ContextSetting ,
3535 DomainContextHandler )
3636from Orange .widgets .utils import datacaching
37+ from Orange .widgets .utils .annotated_data import (create_annotated_table ,
38+ ANNOTATED_DATA_SIGNAL_NAME )
3739from Orange .widgets .utils .itemmodels import TableModel
3840
3941
@@ -367,7 +369,7 @@ class OWDataTable(widget.OWWidget):
367369
368370 inputs = [("Data" , Table , "set_dataset" , widget .Multiple )]
369371 outputs = [("Selected Data" , Table , widget .Default ),
370- ("Other Data" , Table )]
372+ (ANNOTATED_DATA_SIGNAL_NAME , Table )]
371373
372374 show_distributions = Setting (False )
373375 dist_color_RGB = Setting ((220 , 220 , 220 , 255 ))
@@ -506,6 +508,7 @@ def update(f):
506508 self .selected_cols = []
507509 self .openContext (data )
508510 self .set_selection ()
511+ self .commit ()
509512
510513 def _setup_table_view (self , view , data ):
511514 """Setup the `view` (QTableView) with `data` (Orange.data.Table)
@@ -785,7 +788,7 @@ def commit(self):
785788 """
786789 Commit/send the current selected row/column selection.
787790 """
788- selected_data = other_data = None
791+ selected_data = table = rowsel = None
789792 view = self .tabs .currentWidget ()
790793 if view and view .model () is not None :
791794 model = self ._get_model (view )
@@ -795,7 +798,7 @@ def commit(self):
795798 # for SqlTables
796799 if isinstance (table , SqlTable ):
797800 self .send ("Selected Data" , selected_data )
798- self .send ("Other Data" , other_data )
801+ self .send (ANNOTATED_DATA_SIGNAL_NAME , None )
799802 return
800803
801804 rowsel , colsel = self .get_selection (view )
@@ -841,19 +844,14 @@ def select_vars(role):
841844 # Avoid a copy if all/none rows are selected.
842845 if not rowsel :
843846 selected_data = None
844- other_data = select (table , None , domain )
845847 elif len (rowsel ) == len (table ):
846848 selected_data = select (table , None , domain )
847- other_data = None
848849 else :
849850 selected_data = select (table , rowsel , domain )
850- selmask = numpy .ones ((len (table ),), dtype = bool )
851- selmask [rowsel ] = False
852-
853- other_data = select (table , numpy .flatnonzero (selmask ), domain )
854851
855852 self .send ("Selected Data" , selected_data )
856- self .send ("Other Data" , other_data )
853+ self .send (ANNOTATED_DATA_SIGNAL_NAME ,
854+ create_annotated_table (table , rowsel ))
857855
858856 def copy (self ):
859857 """
0 commit comments