File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,7 @@ def _update(self):
260260
261261 labelvar = self .cluster_var_model [self .cluster_var_idx ]
262262 labels , _ = self .data .get_column_view (labelvar )
263+ labels = numpy .asarray (labels , dtype = float )
263264 mask = numpy .isnan (labels )
264265 labels = labels .astype (int )
265266 labels = labels [~ mask ]
Original file line number Diff line number Diff line change 44
55import numpy as np
66
7+ import Orange .data
78from Orange .widgets .utils .annotated_data import ANNOTATED_DATA_SIGNAL_NAME
89from Orange .widgets .visualize .owsilhouetteplot import OWSilhouettePlot
910from Orange .widgets .tests .base import WidgetTest , WidgetOutputsTestMixin
@@ -72,3 +73,14 @@ def test_unknowns_in_labels(self):
7273 self .assertTrue (np .all (np .isfinite (scores_1 )))
7374 # the scores must match
7475 np .testing .assert_almost_equal (scores_1 , scores [valid ], decimal = 12 )
76+
77+ def test_meta_object_dtype (self ):
78+ # gh-1875: Test on mixed string/discrete metas
79+ data = self .data [::5 ]
80+ domain = Orange .data .Domain (
81+ data .domain .attributes , [],
82+ [data .domain ["iris" ],
83+ Orange .data .StringVariable ("S" )]
84+ )
85+ data = data .from_table (domain , data )
86+ self .send_signal ("Data" , data )
You can’t perform that action at this time.
0 commit comments