8000 Linter fixes · numpy/numpy@1b77997 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b77997

Browse files
committed
Linter fixes
1 parent da21d0f commit 1b77997

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

numpy/_core/tests/test_multiarray.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2965,10 +2965,12 @@ def test_partition(self):
29652965
# all after are larger
29662966
assert_array_less(p[i], p[i + 1:])
29672967
self.assert_partitioned(p, [i])
2968-
self.assert_partitioned(d[np.argpartition(d, i, kind=k)], [i])
2968+
self.assert_partitioned(
2969+
d[np.argpartition(d, i, kind=k)], [i])
29692970

29702971
p = np.partition(d1, i, axis=1, kind=k)
2971-
parg < 8000 span class=pl-c1>= d1[np.arange(d1.shape[0])[:, None], np.argpartition(d1, i, axis=1, kind=k)]
2972+
parg = d1[np.arange(d1.shape[0])[:, None],
2973+
np.argpartition(d1, i, axis=1, kind=k)]
29722974
aae(p[:, i], np.array([i] * d1.shape[0], dtype=dt))
29732975
# array_less does not seem to work right
29742976
at((p[:, :i].T <= p[:, i]).all(),
@@ -2980,16 +2982,17 @@ def test_partition(self):
29802982
self.assert_partitioned(parg[row], [i])
29812983

29822984
p = np.partition(d0, i, axis=0, kind=k)
2983-
parg = d0[np.argpartition(d0, i, axis=0, kind=k), np.arange(d0.shape[1])[None, :]]
2985+
parg = d0[np.argpartition(d0, i, axis=0, kind=k),
2986+
np.arange(d0.shape[1])[None, :]]
29842987
aae(p[i, :], np.array([i] * d1.shape[0], dtype=dt))
29852988
# array_less does not seem to work right
29862989
at((p[:i, :] <= p[i, :]).all(),
29872990
msg="%d: %r <= %r" % (i, p[i, :], p[:i, :]))
29882991
at((p[i + 1:, :] > p[i, :]).all(),
29892992
msg="%d: %r < %r" % (i, p[i, :], p[:, i + 1:]))
29902993
for col in range(p.shape[1]):
2991-
self.assert_partitioned(p[:,col], [i])
2992-
self.assert_partitioned(parg[:,col], [i])
2994+
self.assert_partitioned(p[:, col], [i])
2995+
self.assert_partitioned(parg[:, col], [i])
29932996

29942997
# check inplace
29952998
dc = d.copy()
@@ -3005,7 +3008,8 @@ def test_partition(self):
30053008
def assert_partitioned(self, d, kth):
30063009
prev = 0
30073010
for k in np.sort(kth):
3008-
assert_array_compare(operator.__le__, d[prev:k], d[k], err_msg='kth %d' % k)
3011+
assert_array_compare(operator.__le__, d[prev:k], d[k],
3012+
err_msg='kth %d' % k)
30093013
assert_((d[k:] >= d[k]).all(),
30103014
msg="kth %d, %r not greater equal %r" % (k, d[k:], d[k]))
30113015
prev = k + 1

0 commit comments

Comments
 (0)
0