[ENH] Add Groups column to Selected Data in Scatter plot output#2678
[ENH] Add Groups column to Selected Data in Scatter plot output#2678jerneju merged 3 commits intobiolab:masterfrom
Conversation
| self.Outputs.selected_data.send(selected) | ||
| self.Outputs.annotated_data.send(annotated) | ||
| data = self.data | ||
| domain = data.domain |
There was a problem hiding this comment.
There is no check if there is data or not.
There was a problem hiding this comment.
Yet it survived the tests. Not good.
There was a problem hiding this comment.
Oh, it didn't, I just didn't run all tests. Travis caught me. That's good.
| domain.metas + (group_var, )) | ||
| metas = np.hstack((self.data.metas[selection], groups - 1)) | ||
| return Table( | ||
| sel_domain, data.X[selection], data.Y[selection], metas) |
There was a problem hiding this comment.
Wondering, could you somehow reuse/extend create_annotated_table() for this?
There was a problem hiding this comment.
I started by filtering the annotated data, but it was messy. Now I've changed the create_groups_table and it's way simpler. Thanks for the suggestion.
ca1a0bd to
a56c18d
Compare
| self.widget = self.create_widget(OWScatterPlot) | ||
|
|
||
| def _compare_selected_annotated_domains(self, selected, annotated): | ||
| pass |
There was a problem hiding this comment.
This disables an inapplicable test from the base class.
Hierarchical clustering, which has a similar situation, replaces this with checking that the domains have same variables and that the annotation appears only in one domain ... but I don't see much sense in testing this here, so I just disabled the test.
I now added a short comment explaining why the method is overridden.
There was a problem hiding this comment.
I now added a short comment explaining why the method is overridden.
Thanks.
Codecov Report
@@ Coverage Diff @@
## master #2678 +/- ##
==========================================
+ Coverage 75.82% 75.82% +<.01%
==========================================
Files 338 338
Lines 59459 59477 +18
==========================================
+ Hits 45082 45101 +19
+ Misses 14377 14376 -1 |
a56c18d to
888bca5
Compare
888bca5 to
b3c0a0d
Compare
|
As suggested by @BlazZupan, the annotation column is now added as a class if the data had no class before. Any arguments against the change? |
The code in question was removed -- reimplemented differently.
| return None | ||
| return create_groups_table(data, graph.selection, False, "Group") | ||
|
|
||
| def _get_annotated(): |
There was a problem hiding this comment.
Let's consider moving this somewhere else. Code in this function is used in many widgets.
|
You mean |
Issue
When selecting multiple groups in scatter plot, the Selected Data output contains no indication about the group.
Description of changes
send_data.Includes