-
-
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] Add Groups column to Selected Data in Scatter plot output #2678
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no check if there is data or not.
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.
Yet it survived the tests. Not good.
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.
Oh, it didn't, I just didn't run all tests. Travis caught me. That's good.
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.
See comment.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering, could you somehow reuse/extend create_annotated_table()
for this?
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.
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
|
||
cls.signal_name = "Data" | ||
cls.signal_data = cls.data | ||
|
||
def setUp(self): | ||
self.widget = self.create_widget(OWScatterPlot) | ||
|
||
def _compare_selected_annotated_domains(self, selected, annotated): | ||
pass |
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.
What is this?
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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