Skip to content

Commit 6f12808

Browse files
Pylint: Add pylint ignores to more human-friendly formatted matrices
1 parent afa3df8 commit 6f12808

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

Orange/statistics/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def sparse_zero_weights(x, weights):
5555
return weights[zero_indices]
5656
else:
5757
# Can easily be implemented using a coo_matrix
58-
raise NotImplemented(
58+
raise NotImplementedError(
5959
'Computing zero weights on ndimensinal weight matrix is not implemented'
6060
)
6161

Orange/tests/test_distribution.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ def assert_dist_and_unknowns(computed, goal_dist):
353353
[data.DiscreteVariable("d%i" % i, values=list("abc")) for i in range(10)] +
354354
[data.ContinuousVariable("c%i" % i) for i in range(10)])
355355

356+
# pylint: disable=bad-whitespace
356357
X = sp.csr_matrix(
357358
# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
358359
# --------------------------------------------------------------------------------
@@ -433,20 +434,23 @@ def test_compute_distributions_metas(self):
433434

434435
class TestContinuous(unittest.TestCase):
435436
def test_mean(self):
437+
# pylint: disable=bad-whitespace
436438
x = np.array([[0, 5, 10],
437439
[9, 0, 1]])
438440
dist = distribution.Continuous(x)
439441

440442
self.assertEqual(dist.mean(), np.mean(([0] * 9) + [10]))
441443

442444
def test_variance(self):
445+
# pylint: disable=bad-whitespace
443446
x = np.array([[0, 5, 10],
444447
[9, 0, 1]])
445448
dist = distribution.Continuous(x)
446449

447450
self.assertEqual(dist.variance(), np.var(([0] * 9) + [10]))
448451

449452
def test_standard_deviation(self):
453+
# pylint: disable=bad-whitespace
450454
x = np.array([[0, 5, 10],
451455
[9, 0, 1]])
452456
dist = distribution.Continuous(x)

Orange/tests/test_normalize.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ def test_normalize_transform_by_span_zero_class(self):
9797

9898
def test_normalize_sparse(self):
9999
domain = Domain([ContinuousVariable(str(i)) for i in range(3)])
100+
# pylint: disable=bad-whitespace
100101
X = sp.csr_matrix(np.array([
101102
[0, -1, -2],
102103
[0, 1, 2],
103104
]))
104105
data = Table.from_numpy(domain, X)
105106

107+
# pylint: disable=bad-whitespace
106108
solution = sp.csr_matrix(np.array([
107109
[0, -1, -1],
108110
[0, 1, 1],

Orange/tests/test_statistics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import unittest
22
import warnings
3-
43
from functools import wraps
54
from itertools import chain
65

@@ -13,6 +12,7 @@
1312

1413

1514
def dense_sparse(test_case):
15+
# type: (Callable) -> Callable
1616
"""Run a single test case on both dense and sparse data."""
1717
@wraps(test_case)
1818
def _wrapper(self):
@@ -182,6 +182,7 @@ def test_var(self):
182182

183183
class TestDigitize(unittest.TestCase):
184184
def setUp(self):
185+
# pylint: disable=bad-whitespace
185186
self.data = [
186187
np.array([
187188
[0., 1., 0., np.nan, 3., 5.],
@@ -323,6 +324,7 @@ def test_1d_weights_with_axis_1(self, array):
323324

324325
@dense_sparse
325326
def test_2d_weights(self, array):
327+
# pylint: disable=bad-whitespace
326328
x = array([[np.nan, np.nan, 1, 1 ],
327329
[ 0, np.nan, 2, np.nan ]])
328330
w = np.array([[1, 2, 3, 4],

0 commit comments

Comments
 (0)