Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] owheatmap: Fix assertion error when restoring selection #5517

Conversation

ales-erjavec
Copy link
Contributor

@ales-erjavec ales-erjavec commented Jul 8, 2021

Issue

Heatmap widget raises an assertion error when restoring selection and the input data has only a single column and columns clustering is selected.

-------------------------- AssertionError Exception ---------------------------
Traceback (most recent call last):
  File "/Users/aleserjavec/Documents/workspace/orange-canvas/orangecanvas/scheme/signalmanager.py", line 1125, in __process_next
    if self.__process_next_helper(use_max_active=True):
  File "/Users/aleserjavec/Documents/workspace/orange-canvas/orangecanvas/scheme/signalmanager.py", line 1164, in __process_next_helper
    self.process_node(selected_node)
  File "/Users/aleserjavec/Documents/workspace/orange-canvas/orangecanvas/scheme/signalmanager.py", line 707, in process_node
    self.send_to_node(node, signals_in)
  File "/Users/aleserjavec/Documents/workspace/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 805, in send_to_node
    self.process_signals_for_widget(node, widget, signals)
  File "/Users/aleserjavec/Documents/workspace/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 819, in process_signals_for_widget
    process_signals_for_widget(widget, signals, workflow)
  File "/Users/aleserjavec/.local/opt/python3.8/Python.framework/Versions/3.8/lib/python3.8/functools.py", line 875, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/aleserjavec/Documents/workspace/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 920, in process_signals_for_widget
    process_signal_input(input_meta, widget, signal, workflow)
  File "/Users/aleserjavec/.local/opt/python3.8/Python.framework/Versions/3.8/lib/python3.8/functools.py", line 875, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/aleserjavec/Documents/workspace/orange-widget-base/orangewidget/workflow/widgetsscheme.py", line 883, in process_signal_input_default
    notify_input_helper(
  File "/Users/aleserjavec/.local/opt/python3.8/Python.framework/Versions/3.8/lib/python3.8/functools.py", line 875, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/Users/aleserjavec/Documents/workspace/orange-widget-base/orangewidget/utils/signals.py", line 643, in set_input_helper
    handler(*args)
  File "/Users/aleserjavec/Documents/workspace/orange-widget-base/orangewidget/utils/signals.py", line 198, in summarize_wrapper
    method(widget, value)
  File "/Users/aleserjavec/Documents/workspace/orange3/Orange/widgets/visualize/owheatmap.py", line 665, in set_dataset
    assert self.scene.widget is not None
AssertionError
-------------------------------------------------------------------------------

Easiest way to test is to File -> Heatmap, select column clustering and select a couple of rows in the heatmap, then duplicate/copy/paste the Heatmap, add File -> Select Columns, select single column in Select Columns and connect Select Columns -> Heatmap (2)

Description of changes

Fix assertion error when restoring selection

Includes
  • Code changes
  • Tests

... when input does not have enough columns for clustering.
@janezd janezd force-pushed the fixes/owheatmap-selection-restore-assert-error branch from dea98f8 to 95b35c5 Compare July 27, 2021 06:59
@codecov
Copy link

codecov bot commented Jul 27, 2021

Codecov Report

Merging #5517 (95b35c5) into master (f9d78d6) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5517      +/-   ##
==========================================
- Coverage   86.38%   86.37%   -0.01%     
==========================================
  Files         304      304              
  Lines       61753    61753              
==========================================
- Hits        53344    53341       -3     
- Misses       8409     8412       +3     

@janezd janezd merged commit b553ebc into biolab:master Jul 27, 2021
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