File tree Expand file tree Collapse file tree 6 files changed +8
-7
lines changed
Expand file tree Collapse file tree 6 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1080,6 +1080,8 @@ def test_embedding_missing_values(self):
10801080 output = self .get_output (ANNOTATED_DATA_SIGNAL_NAME )
10811081 embedding_mask = np .all (np .isnan (output .metas [:, :2 ]), axis = 1 )
10821082 np .testing .assert_array_equal (~ embedding_mask , self .widget .valid_data )
1083+ # reload
1084+ self .send_signal (self .widget .Inputs .data , table )
10831085
10841086 def test_sparse_data (self ):
10851087 table = Table ("iris" )
Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ def error(err):
267267 error (self .Error .features_exceeds_instances )
268268 elif not np .sum (np .std (self .data .X , axis = 0 )):
269269 error (self .Error .constant_data )
270- elif np .sum (self .valid_data ) > self .MAX_INSTANCES :
270+ elif np .sum (np . all ( np . isfinite ( self .data . X ), axis = 1 ) ) > self .MAX_INSTANCES :
271271 error (self .Error .too_many_data_instances )
272272 else :
273273 if len (self .effective_variables ) < len (domain .attributes ):
Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ def _init_vizrank(self):
407407 elif len ([v for v in self .continuous_variables
408408 if v is not self .attr_color ]) < 3 :
409409 msg = "Not enough available continuous variables"
410- elif len ( self .data [ self . valid_data ] ) < 2 :
410+ elif np . sum ( np . all ( np . isfinite ( self .data . X ), axis = 1 ) ) < 2 :
411411 msg = "Not enough valid data instances"
412412 else :
413413 is_enabled = not np .isnan (self .data .get_column_view (
Original file line number Diff line number Diff line change @@ -368,7 +368,7 @@ def _init_vizrank(self):
368368 self .attr_color is not None and \
369369 not np .isnan (self .data .get_column_view (
370370 self .attr_color )[0 ].astype (float )).all () and \
371- len ( self .data [ self . valid_data ] ) > 1 and \
371+ np . sum ( np . all ( np . isfinite ( self .data . X ), axis = 1 ) ) > 1 and \
372372 np .all (np .nan_to_num (np .nanstd (self .data .X , 0 )) != 0 )
373373 self .btn_vizrank .setEnabled (is_enabled )
374374 if is_enabled :
Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ def findvar(name, iterable):
341341 self .attr_size = findvar (self .attr_size , self .gui .size_model )
342342
343343 def check_data (self ):
344- self . clear_messages ()
344+ super (). check_data ()
345345 self .__timer .stop ()
346346 self .sampling .setVisible (False )
347347 self .sql_data = None
Original file line number Diff line number Diff line change @@ -442,7 +442,6 @@ def set_data(self, data):
442442 self .enable_controls ()
443443
444444 def check_data (self ):
445- self .valid_data = None
446445 self .clear_messages ()
447446
448447 def use_context (self ):
@@ -649,8 +648,7 @@ def error(err):
649648 elif len (self .data ) < 2 :
650649 error (self .Error .no_instances )
651650 else :
652- self .valid_data = np .all (np .isfinite (self .data .X ), axis = 1 )
653- if not np .sum (self .valid_data ):
651+ if not np .sum (np .all (np .isfinite (self .data .X ), axis = 1 )):
654652 error (self .Error .no_valid_data )
655653
656654 def init_projection (self ):
@@ -663,6 +661,7 @@ def init_projection(self):
663661 self .Error .proj_error (ex )
664662
665663 def get_embedding (self ):
664+ self .valid_data = None
666665 if self .data is None or self .projection is None :
667666 return None
668667 embedding = self .projection (self .data ).X
You can’t perform that action at this time.
0 commit comments