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] Annotator: Invalidate clusters on setting change #910

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

VesnaT
Copy link
Contributor

@VesnaT VesnaT commented Oct 17, 2022

Issue

The widget crashes with

Traceback (most recent call last):
  File "/Users/vesna/orange-widget-base/orangewidget/gui.py", line 2258, in __call__
    self.func(**kwds)
  File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owannotator.py", line 327, in __on_clustering_type_changed
    self._run()
  File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owannotator.py", line 379, in _run
    self.graph.update_clusters()  # Remove cluster hulls and labels
  File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owannotator.py", line 154, in update_clusters
    self._update_cluster_hull()
  File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owannotator.py", line 162, in _update_cluster_hull
    hulls = self.master.get_cluster_hulls()
  File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owannotator.py", line 525, in get_cluster_hulls
    return [(hull, colors[key])
  File "/Users/vesna/orange3-text/orangecontrib/text/widgets/owannotator.py", line 525, in <listcomp>
    return [(hull, colors[key])
IndexError: index 3 is out of bounds for axis 0 with size 3

To reproduce:
Corpus (book-excerpts) -> tSNE -> Annotated Corpus Maps (1. select Gaussian mixture models with 4 clusters, 2. select From variable)

Description of changes
  • invalidate clusters if settings change
Includes
  • Code changes
  • Tests
  • Documentation

@PrimozGodec
Copy link
Collaborator

/rebase

@codecov-commenter
Copy link

Codecov Report

Merging #910 (068315b) into master (1a384dc) will increase coverage by 0.08%.
The diff coverage is 50.00%.

❗ Current head 068315b differs from pull request most recent head 9522847. Consider uploading reports for the commit 9522847 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #910      +/-   ##
==========================================
+ Coverage   77.07%   77.15%   +0.08%     
==========================================
  Files          86       86              
  Lines       12037    12039       +2     
  Branches     1578     1578              
==========================================
+ Hits         9277     9289      +12     
+ Misses       2453     2448       -5     
+ Partials      307      302       -5     

@PrimozGodec PrimozGodec merged commit 3bd4592 into biolab:master Oct 17, 2022
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.

3 participants