-
-
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
[FIX] Sieve Diagram: Using datasets with meta data #2098
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2098 +/- ##
==========================================
- Coverage 71.48% 71.31% -0.17%
==========================================
Files 318 318
Lines 54393 54278 -115
==========================================
- Hits 38881 38709 -172
- Misses 15512 15569 +57 Continue to review full report at Codecov.
|
@@ -167,13 +167,10 @@ def set_data(self, data): | |||
self.domain_model.set_domain(None) | |||
else: | |||
self.domain_model.set_domain(data.domain) | |||
if any(attr.is_continuous for attr in 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.
The idea here was to avoid unnecessary calls to Discretize
. Wouldn't it be better to just replace the above condition with something like
if any(attr.is_continuous for attr in chain(data.domain, data.domain.metas)):
and leave the rest as it is?
[42.48, 16.84, 15.23, 23.8], | ||
"yynn")) | ||
) | ||
self.send_signal("Data", table) |
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 checks just that the widget does not crash. It is difficult to test this widget assuming anything about the widget internals. For the lack of better options, I'd replace self.send_signal("Data", table)
with
from unittest.mock import patch
from Orange.widgets.visualize.owsieve import Discretize
with patch("Orange.widgets.visualize.owsieve.Discretize",
wraps=Discretize) as disc:
self.send_signal("Data", table)
self.assertTrue(disc.called)
metas = self.widget.discrete_data.domain.metas
self.assertEqual(len(metas), 2)
self.assertTrue(all(attr.is_discrete for attr in metas))
Move imports to the beginning of the file, of course.
Issue Widget should intepret meta data which are continuous or discrete in the same way as features or target. https://sentry.io/biolab/orange3/issues/231234770/ https://sentry.io/biolab/orange3/issues/232101010/
Issue
Widget should intepret meta data which are continuous or discrete in the same way
as features or target.
https://sentry.io/biolab/orange3/issues/231234770/
Description of changes
Includes