Skip to content

[FIX] Fix wrong assert in heatmap#4955

Merged
janezd merged 2 commits intobiolab:masterfrom
ales-erjavec:fixes/owheatmap-assert-conditions
Aug 25, 2020
Merged

[FIX] Fix wrong assert in heatmap#4955
janezd merged 2 commits intobiolab:masterfrom
ales-erjavec:fixes/owheatmap-assert-conditions

Conversation

@ales-erjavec
Copy link
Contributor

Issue

Heatmap widget raises an error if a dataset with exactly 1000 instances in on input and 'Clustering (opt. ordering) is selected for Row clustering.

-------------------------- AssertionError Exception ---------------------------
Traceback (most recent call last):
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 313, in _
    self.set_row_clustering(cb.itemData(idx, ClusteringRole))
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 528, in set_row_clustering
    self.__update_row_clustering()
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 1089, in __update_row_clustering
    self.update_heatmaps()
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 726, in update_heatmaps
    parts = self.construct_heatmaps(self.data, self.split_by_var, self.split_columns_var)
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 901, in construct_heatmaps
    ordered=self.row_clustering == Clustering.OrderedClustering
  File "/Users/aleserjavec/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 804, in cluster_rows
    assert len(matrix) < self.MaxOrderedClustering
AssertionError

This is due to an wrong condition in the assert

Description of changes
  • Remove asserts
Includes
  • Code changes
  • Tests
  • Documentation

@janezd janezd merged commit a2c7ac7 into biolab:master Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants