[FIX] OWDistanceMatrix: attribute in context#1761
Merged
astaric merged 2 commits intobiolab:masterfrom Nov 30, 2016
Merged
Conversation
owdistancematrix.py: prevent attribute error when showing distances between columns with an empty context.
Current coverage is 88.81% (diff: 100%)@@ 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
|
Member
|
Can you try to reproduce the issue in a test? |
janezd
previously requested changes
Nov 18, 2016
Contributor
janezd
left a comment
There was a problem hiding this comment.
Why not use migrations here?
Such if-s pollute the code and should be eliminated (=moved to migration methods) in other widgets as well.
…, 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.
PR changed, new fix is unrelated to migrations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
AttributeError: Context has no attribute 'annotation'
Workflow:
Description of changes
Attribute check.
Includes
owdistancematrix.py: prevent attribute error when showing distances between columns with an empty context.