[ENH] SelectByDataIndex: data info displayed in the status bar#4595
Merged
VesnaT merged 1 commit intobiolab:masterfrom Apr 2, 2020
Merged
[ENH] SelectByDataIndex: data info displayed in the status bar#4595VesnaT merged 1 commit intobiolab:masterfrom
VesnaT merged 1 commit intobiolab:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4595 +/- ##
==========================================
- Coverage 83.61% 83.59% -0.03%
==========================================
Files 281 276 -5
Lines 56189 55387 -802
==========================================
- Hits 46982 46300 -682
+ Misses 9207 9087 -120 |
VesnaT
requested changes
Apr 1, 2020
| def handleNewSignals(self): | ||
| if self.data and self.data_subset: | ||
| data_list = [('Data', self.data), ('Data subset', self.data_subset)] | ||
| summary = f"{len(self.data)}, {len(self.data_subset)}" |
Contributor
There was a problem hiding this comment.
When creating summary text self.info.format_number() should be used to format the numbers.
| self.info.set_input_summary(summary, details, format=Qt.RichText) | ||
| elif not self.data and not self.data_subset: | ||
| self.info.set_input_summary(self.info.NoInput) | ||
| else: |
Contributor
There was a problem hiding this comment.
The two inputs are considered equivalent, so I would omit this else and replace the upper condition self.data and self.data_subset with self.data or self.data_subset.
When only one dataset is on the input, just show 0 in the summary.
Something like:
summary, detail, kwargs = self.info.NoInput, "", {}
if self.data or self.data_subset:
n_data = len(self.data) if self.data else 0
n_data_subset = len(self.data_subset) if self.data_subset else 0
summary = f"{self.info.format_number(n_data)}, " \
f"{self.info.format_number(n_data_subset)}"
kwargs = {"format": Qt.RichText}
detail = format_multiple_summaries([
("Data", self.data),
("Data subset", self.data_subset)
])
self.info.set_input_summary(summary, detail, **kwargs)
| non_matching_output = self.data[~row_sel] | ||
| annotated_output = create_annotated_table(self.data, row_sel) | ||
|
|
||
| summary = len(matching_output) if matching_output else self.info.NoOutput |
Contributor
There was a problem hiding this comment.
This is not true.
matching_output evaluates to False when len(matching_output) == 0, causing summary = self.info.NoOutput, even though dataset with 0 instances was send to the output.
3597cf4 to
92a47c7
Compare
92a47c7 to
20778de
Compare
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.
Description of changes
Input/output data info displayed in the status bar.
Includes