Skip to content

Commit

Permalink
Merge pull request #2384 from jerneju/type-scatterplot-features
Browse files Browse the repository at this point in the history
[FIX] Scatter Plot: features and no data
  • Loading branch information
kernc authored Jun 12, 2017
2 parents b9f65fe + 045c24a commit 9ba1d91
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Orange/widgets/visualize/owscatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def set_subset_data(self, subset_data):
def handleNewSignals(self):
self.graph.new_data(self.sparse_to_dense(self.data_metas_X),
self.sparse_to_dense(self.subset_data))
if self.attribute_selection_list and \
if self.attribute_selection_list and self.graph.domain and \
all(attr in self.graph.domain
for attr in self.attribute_selection_list):
self.attr_x = self.attribute_selection_list[0]
Expand Down
8 changes: 8 additions & 0 deletions Orange/widgets/visualize/tests/test_owscatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ def test_sparse(self):
self.assertTrue(data.is_sparse())
self.assertEqual(len(data.domain), 5)

def test_features_and_no_data(self):
"""
Prevent crashing when features are sent but no data.
GH-2384
"""
domain = Table("iris").domain
self.send_signal(self.widget.Inputs.features, domain)


if __name__ == "__main__":
import unittest
Expand Down

0 comments on commit 9ba1d91

Please sign in to comment.