Skip to content

[FIX] Distributions: show probabilities upon selection#2428

Merged
lanzagar merged 1 commit intobiolab:masterfrom
jerneju:show-probabilities-distributions
Jul 26, 2017
Merged

[FIX] Distributions: show probabilities upon selection#2428
lanzagar merged 1 commit intobiolab:masterfrom
jerneju:show-probabilities-distributions

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


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