|
| 1 | +import os |
1 | 2 | import unittest |
2 | 3 |
|
3 | 4 | import numpy as np |
|
20 | 21 | ANNOTATED_DATA_SIGNAL_NAME) |
21 | 22 |
|
22 | 23 | # For tests, let memory freeing entirely to Python / OS |
23 | | -import sip |
24 | 24 | sip.setdestroyonexit(False) |
25 | 25 |
|
26 | 26 | app = None |
@@ -163,6 +163,9 @@ def send_signal(self, input_name, value, *args, widget=None): |
163 | 163 | if input_signal.name == input_name: |
164 | 164 | getattr(widget, input_signal.handler)(value, *args) |
165 | 165 | break |
| 166 | + else: |
| 167 | + raise ValueError("'{}' is not an input name for widget {}" |
| 168 | + .format(input_name, type(widget).__name__)) |
166 | 169 | widget.handleNewSignals() |
167 | 170 |
|
168 | 171 | def get_output(self, output_name, widget=None): |
@@ -540,3 +543,55 @@ def _compare_selected_annotated_domains(self, selected, annotated): |
540 | 543 | selected_vars = selected.domain.variables + selected.domain.metas |
541 | 544 | annotated_vars = annotated.domain.variables + annotated.domain.metas |
542 | 545 | self.assertLess(set(selected_vars), set(annotated_vars)) |
| 546 | + |
| 547 | + |
| 548 | +class datasets: |
| 549 | + @staticmethod |
| 550 | + def path(filename): |
| 551 | + dirname = os.path.join(os.path.dirname(__file__), "datasets") |
| 552 | + return os.path.join(dirname, filename) |
| 553 | + |
| 554 | + @classmethod |
| 555 | + def missing_data_1(cls): |
| 556 | + """ |
| 557 | + Data set with 3 continuous features (X{1,2,3}) where all the columns |
| 558 | + and rows contain at least one NaN value. |
| 559 | +
|
| 560 | + One discrete class D with NaN values |
| 561 | + Mixed continuous/discrete/string metas ({X,D,S}M) |
| 562 | +
|
| 563 | + Returns |
| 564 | + ------- |
| 565 | + data : Orange.data.Table |
| 566 | + """ |
| 567 | + return Table(cls.path("missing_data_1.tab")) |
| 568 | + |
| 569 | + @classmethod |
| 570 | + def missing_data_2(cls): |
| 571 | + """ |
| 572 | + Data set with 3 continuous features (X{1,2,3}) where all the columns |
| 573 | + and rows contain at least one NaN value and X1, X2 are constant. |
| 574 | +
|
| 575 | + One discrete constant class D with NaN values. |
| 576 | + Mixed continuous/discrete/string class metas ({X,D,S}M) |
| 577 | +
|
| 578 | + Returns |
| 579 | + ------- |
| 580 | + data : Orange.data.Table |
| 581 | + """ |
| 582 | + return Table(cls.path("missing_data_2.tab")) |
| 583 | + |
| 584 | + @classmethod |
| 585 | + def missing_data_3(cls): |
| 586 | + """ |
| 587 | + Data set with 3 discrete features D{1,2,3} where all the columns and |
| 588 | + rows contain at least one NaN value |
| 589 | +
|
| 590 | + One discrete class D with NaN values |
| 591 | + Mixes continuous/discrete/string metas ({X,D,S}M) |
| 592 | +
|
| 593 | + Returns |
| 594 | + ------- |
| 595 | + data : Orange.data.Table |
| 596 | + """ |
| 597 | + return Table(cls.path("missing_data_3.tab")) |
0 commit comments