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] OWDistanceMatrix: attribute in context #1761

Merged
merged 2 commits into from
Nov 30, 2016

Conversation

acopar
Copy link
Contributor

@acopar acopar commented Nov 18, 2016

Issue

AttributeError: Context has no attribute 'annotation'

Workflow:

  1. File widget (iris) -> Distance (choose rows, euclidean) -> DistanceMatrix.
  2. Open Distance widget and select columns.
Description of changes

Attribute check.

Includes
  • Code changes
  • Tests
  • Documentation

owdistancematrix.py: prevent attribute error when showing distances between columns with an empty context.

owdistancematrix.py: prevent attribute error when showing distances between columns with an empty context.
@CLAassistant
Copy link

CLAassistant commented Nov 18, 2016

CLA assistant check
All committers have signed the CLA.

@codecov-io
Copy link

codecov-io commented Nov 18, 2016

Current coverage is 88.81% (diff: 100%)

Merging #1761 into master will decrease coverage by 0.10%

@@             master      #1761   diff @@
==========================================
  Files            82         82          
  Lines          8847       8892    +45   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           7866       7897    +31   
- Misses          981        995    +14   
  Partials          0          0          

Sunburst

Powered by Codecov. Last update 92bba3f...7db7965

@astaric
Copy link
Member

astaric commented Nov 18, 2016

Can you try to reproduce the issue in a test?

janezd
janezd previously requested changes Nov 18, 2016
Copy link
Contributor

@janezd janezd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use migrations here?

Such if-s pollute the code and should be eliminated (=moved to migration methods) in other widgets as well.

@acopar acopar changed the title [FIX] owdistancematrix.py: attribute in context [WIP][FIX] OWDistanceMatrix: attribute in context Nov 25, 2016
@astaric astaric added this to the 3.3.9 milestone Nov 25, 2016
…, write a test.

owdistancematrix.py:
- DistanceMatrixContextHandler: create annotation attribute when creating new context.
- Revert hasattr fix.
- annotation_idx was not used anywhere else, default is 1.
test_owdistancematrix.py: write a test to reproduce this issue.

*Migrations were not a solution, because the problem was not incompatibility with previous version, rather the missing attribute in DistanceMatrixContextHandler class.
@acopar acopar changed the title [WIP][FIX] OWDistanceMatrix: attribute in context [FIX] OWDistanceMatrix: attribute in context Nov 25, 2016
@janezd janezd dismissed their stale review November 26, 2016 18:27

PR changed, new fix is unrelated to migrations.

@astaric astaric merged commit c4881d9 into biolab:master Nov 30, 2016
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.

5 participants