@@ -18,13 +18,17 @@ class TestOWScatterPlot(WidgetTest, WidgetOutputsTestMixin):
1818 def setUpClass (cls ):
1919 super ().setUpClass ()
2020 WidgetOutputsTestMixin .init (cls )
21+ cls .same_input_output_domain = False
2122
2223 cls .signal_name = "Data"
2324 cls .signal_data = cls .data
2425
2526 def setUp (self ):
2627 self .widget = self .create_widget (OWScatterPlot )
2728
29+ def _compare_selected_annotated_domains (self , selected , annotated ):
30+ pass
31+
2832 def test_set_data (self ):
2933 # Connect iris to scatter plot
3034 self .send_signal (self .widget .Inputs .data , self .data )
@@ -154,6 +158,9 @@ def test_group_selections(self):
154158 def selectedx ():
155159 return self .get_output (self .widget .Outputs .selected_data ).X
156160
161+ def selected_groups ():
162+ return self .get_output (self .widget .Outputs .selected_data ).metas [:, 0 ]
163+
157164 def annotated ():
158165 return self .get_output (self .widget .Outputs .annotated_data ).metas
159166
@@ -163,6 +170,7 @@ def annotations():
163170 # Select 0:5
164171 graph .select (points [:5 ])
165172 np .testing .assert_equal (selectedx (), x [:5 ])
173+ np .testing .assert_equal (selected_groups (), np .zeros (5 ))
166174 sel_column [:5 ] = 1
167175 np .testing .assert_equal (annotated (), sel_column )
168176 self .assertEqual (annotations (), ["No" , "Yes" ])
@@ -171,6 +179,7 @@ def annotations():
171179 with self .modifiers (Qt .ShiftModifier ):
172180 graph .select (points [5 :10 ])
173181 np .testing .assert_equal (selectedx (), x [:10 ])
182+ np .testing .assert_equal (selected_groups (), np .array ([0 ] * 5 + [1 ] * 5 ))
174183 sel_column [5 :10 ] = 2
175184 np .testing .assert_equal (annotated (), sel_column )
176185 self .assertEqual (len (annotations ()), 3 )
@@ -180,12 +189,14 @@ def annotations():
180189 sel_column = np .zeros ((len (self .data ), 1 ))
181190 sel_column [15 :20 ] = 1
182191 np .testing .assert_equal (selectedx (), x [15 :20 ])
192+ np .testing .assert_equal (selected_groups (), np .zeros (5 ))
183193 self .assertEqual (annotations (), ["No" , "Yes" ])
184194
185195 # Alt-select (remove) 10:17; we have 17:20
186196 with self .modifiers (Qt .AltModifier ):
187197 graph .select (points [10 :17 ])
188198 np .testing .assert_equal (selectedx (), x [17 :20 ])
199+ np .testing .assert_equal (selected_groups (), np .zeros (3 ))
189200 sel_column [15 :17 ] = 0
190201 np .testing .assert_equal (annotated (), sel_column )
191202 self .assertEqual (annotations (), ["No" , "Yes" ])
@@ -194,6 +205,7 @@ def annotations():
194205 with self .modifiers (Qt .ShiftModifier | Qt .ControlModifier ):
195206 graph .select (points [20 :25 ])
196207 np .testing .assert_equal (selectedx (), x [17 :25 ])
208+ np .testing .assert_equal (selected_groups (), np .zeros (8 ))
197209 sel_column [20 :25 ] = 1
198210 np .testing .assert_equal (annotated (), sel_column )
199211 self .assertEqual (annotations (), ["No" , "Yes" ])
@@ -205,6 +217,7 @@ def annotations():
205217 with self .modifiers (Qt .ShiftModifier | Qt .ControlModifier ):
206218 graph .select (points [35 :40 ])
207219 sel_column [30 :40 ] = 2
220+ np .testing .assert_equal (selected_groups (), np .array ([0 ] * 8 + [1 ] * 10 ))
208221 np .testing .assert_equal (annotated (), sel_column )
209222 self .assertEqual (len (annotations ()), 3 )
210223
0 commit comments