[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 +57Continue to review full report at Codecov.
|
| 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.
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.
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