-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[ENH] SelectByDataIndex: data info displayed in the status bar #4595
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 |
@@ -62,6 +69,18 @@ def set_data_subset(self, data): | |||
self.infoBoxExtraData.setText(self.data_info_text(data)) | |||
|
|||
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)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
@@ -89,6 +108,10 @@ def commit(self): | |||
matching_output = self.data[row_sel] | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Description of changes
Input/output data info displayed in the status bar.
Includes