|
4 | 4 | from unittest.mock import patch, Mock |
5 | 5 |
|
6 | 6 | import numpy as np |
| 7 | +from sklearn.utils import check_random_state |
| 8 | +from sklearn.utils.extmath import svd_flip |
7 | 9 |
|
8 | 10 | from Orange.data import Table, Domain, ContinuousVariable, TimeVariable |
9 | 11 | from Orange.preprocess import preprocess |
10 | 12 | from Orange.widgets.tests.base import WidgetTest |
11 | 13 | from Orange.widgets.tests.utils import table_dense_sparse, possible_duplicate_table |
12 | 14 | from Orange.widgets.unsupervised.owpca import OWPCA |
13 | 15 | from Orange.tests import test_filename |
14 | | -from sklearn.utils import check_random_state |
15 | | -from sklearn.utils.extmath import svd_flip |
16 | 16 |
|
17 | 17 |
|
18 | 18 | class TestOWPCA(WidgetTest): |
@@ -63,19 +63,19 @@ def test_limit_components(self): |
63 | 63 | self.widget._setup_plot() # pylint: disable=protected-access |
64 | 64 |
|
65 | 65 | def test_migrate_settings_limits_components(self): |
66 | | - settings = dict(ncomponents=10) |
| 66 | + settings = {"ncomponents": 10} |
67 | 67 | OWPCA.migrate_settings(settings, 0) |
68 | 68 | self.assertEqual(settings['ncomponents'], 10) |
69 | | - settings = dict(ncomponents=101) |
| 69 | + settings = {"ncomponents": 101} |
70 | 70 | OWPCA.migrate_settings(settings, 0) |
71 | 71 | self.assertEqual(settings['ncomponents'], 100) |
72 | 72 |
|
73 | 73 | def test_migrate_settings_changes_variance_covered_to_int(self): |
74 | | - settings = dict(variance_covered=17.5) |
| 74 | + settings = {"variance_covered": 17.5} |
75 | 75 | OWPCA.migrate_settings(settings, 0) |
76 | 76 | self.assertEqual(settings["variance_covered"], 17) |
77 | 77 |
|
78 | | - settings = dict(variance_covered=float('nan')) |
| 78 | + settings = {"variance_covered": float('nan')} |
79 | 79 | OWPCA.migrate_settings(settings, 0) |
80 | 80 | self.assertEqual(settings["variance_covered"], 100) |
81 | 81 |
|
@@ -282,7 +282,7 @@ def test_table_subclass(self): |
282 | 282 | When input table is instance of Table's subclass (e.g. Corpus) resulting |
283 | 283 | tables should also be an instance subclasses |
284 | 284 | """ |
285 | | - class TableSub(Table): |
| 285 | + class TableSub(Table): # pylint: disable=abstract-method |
286 | 286 | pass |
287 | 287 |
|
288 | 288 | table_subclass = TableSub(self.iris) |
|
0 commit comments