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] Distributions: show probabilities upon selection #2428

Merged
merged 1 commit into from
Jul 26, 2017
Merged

[FIX] Distributions: show probabilities upon selection #2428

merged 1 commit into from
Jul 26, 2017

Conversation

jerneju
Copy link
Contributor

@jerneju jerneju commented Jun 23, 2017

Issue

Fixes #2420 .

Description of changes
Includes
  • Code changes
  • Tests
  • Documentation

@jerneju
Copy link
Contributor Author

jerneju commented Jun 23, 2017

@@ -371,8 +371,6 @@ def display_distribution(self):
self.tooltip_items.append((self.plot, item))

def _on_relative_freq_changed(self):
if not self.distributions:
return
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should keep these two lines, too.

Connect File -> Distributions to give some data to Distributions. Now remove the data by deleting the connection. Click Show relative frequencies and the widget will crash. These two lines prevent this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. If we really wanted to keep this check, we would write if self.distributions is None or not len(self.distributions).

However this check should not be here. self.distributions can be empty or None, but self.contingencies may be filled with values and that is the reason that the code below should be executed.

Crash is now prevented in a different way.

@codecov-io
Copy link

codecov-io commented Jun 26, 2017

Codecov Report

Merging #2428 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2428      +/-   ##
==========================================
- Coverage   74.36%   74.33%   -0.03%     
==========================================
  Files         321      321              
  Lines       55993    55999       +6     
==========================================
- Hits        41639    41627      -12     
- Misses      14354    14372      +18

@lanzagar lanzagar added this to the 3.4.5 milestone Jul 26, 2017
@lanzagar lanzagar merged commit 8f814e4 into biolab:master Jul 26, 2017
@jerneju jerneju deleted the show-probabilities-distributions branch July 26, 2017 10:31
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.

4 participants