[FIX] Distributions: show probabilities upon selection#2428
[FIX] Distributions: show probabilities upon selection#2428lanzagar merged 1 commit intobiolab:masterfrom jerneju:show-probabilities-distributions
Conversation
|
|
||
| def _on_relative_freq_changed(self): | ||
| if not self.distributions: | ||
| return |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 Report
@@ 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 |
Issue
Fixes #2420 .
Description of changes
Includes