Skip to content

Commit daf1332

Browse files
Joseph-Edwardsjames-d-mitchell
authored andcommitted
Lint: purge some pylints
1 parent 7ec1dfe commit daf1332

26 files changed

Lines changed: 121 additions & 138 deletions

src/libsemigroups_pybind11/detail/cxx_wrapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ def register_cxx_wrapped_type(cxx_type: pybind11_type, py_type: type) -> None:
5959

6060
class CxxWrapper:
6161
# pylint: disable=missing-class-docstring
62-
# pylint: disable=protected-access, no-member
6362
def __init__(
6463
self: Self,
6564
*args,

tests/cong_common.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# pylint: disable=no-name-in-module, missing-function-docstring
3-
# pylint: disable=missing-class-docstring, invalid-name
4-
52
# Copyright (c) 2021-2024 J. D. Mitchell
63
#
74
# Distributed under the terms of the GPL license version 3.
@@ -13,16 +10,16 @@
1310
CongruenceCommon.
1411
"""
1512

16-
# pylint: disable=no-name-in-module, missing-function-docstring, invalid-name
17-
1813
from libsemigroups_pybind11 import (
1914
Presentation,
2015
congruence_kind,
2116
presentation,
2217
)
2318

2419

25-
def check_congruence_common_return_policy(TestType):
20+
def check_congruence_common_return_policy(
21+
TestType,
22+
): # pylint: disable=missing-function-docstring, invalid-name
2623
p = Presentation("ab")
2724
presentation.add_rule(p, "abab", "a" * 6)
2825
presentation.add_rule(p, "ba", "ababbb")

tests/runner.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# pylint: disable=no-name-in-module, missing-function-docstring
3-
# pylint: disable=missing-class-docstring, invalid-name
4-
52
# Copyright (c) 2021-2024 J. D. Mitchell
63
#
74
# Distributed under the terms of the GPL license version 3.
@@ -17,12 +14,14 @@
1714

1815
from libsemigroups_pybind11 import ReportGuard
1916

20-
n = 0
17+
N = 0
2118

2219

23-
def check_runner(x, t=timedelta(microseconds=1000)):
24-
global n # pylint: disable=global-statement
25-
n = 0
20+
def check_runner(
21+
x, t=timedelta(microseconds=1000)
22+
): # pylint: disable=missing-function-docstring
23+
global N # pylint: disable=global-statement
24+
N = 0
2625
ReportGuard(False)
2726

2827
assert not x.stopped()
@@ -47,9 +46,9 @@ def check_runner(x, t=timedelta(microseconds=1000)):
4746
pass
4847

4948
def func():
50-
global n # pylint: disable=global-statement
51-
n += 1
52-
return n >= 2
49+
global N # pylint: disable=global-statement
50+
N += 1
51+
return N >= 2
5352

5453
x.run_until(func)
5554

tests/test_action.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
arising from action.*pp in libsemigroups.
1212
"""
1313

14-
# pylint: disable=no-name-in-module, missing-function-docstring, invalid-name
15-
# pylint: disable=redefined-outer-name, no-member
14+
# pylint: disable=missing-function-docstring
1615

1716
import pytest
1817

@@ -30,8 +29,8 @@
3029
from libsemigroups_pybind11.bmat8 import row_space_basis, col_space_basis
3130

3231

33-
@pytest.fixture
34-
def right_actions():
32+
@pytest.fixture(name="right_actions")
33+
def fixture_right_actions():
3534
seed = row_space_basis(
3635
BMat8([[1, 1, 1, 0], [1, 1, 0, 0], [0, 1, 0, 1], [0, 1, 0, 0]])
3736
)
@@ -142,8 +141,8 @@ def right_actions():
142141
return result
143142

144143

145-
@pytest.fixture
146-
def left_actions():
144+
@pytest.fixture(name="left_actions")
145+
def fixture_left_actions():
147146
seed = col_space_basis(
148147
BMat8([[1, 1, 1, 0], [1, 1, 0, 0], [0, 1, 0, 1], [0, 1, 0, 0]])
149148
)
@@ -205,8 +204,8 @@ def left_actions():
205204
return result
206205

207206

208-
@pytest.fixture
209-
def extreme_left_actions():
207+
@pytest.fixture(name="extreme_left_actions")
208+
def fixture_extreme_left_actions():
210209
result = []
211210
result.append(
212211
LeftAction(

tests/test_adapters.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
arising from adapters.*pp in libsemigroups.
1212
"""
1313

14-
# pylint: disable=no-name-in-module, missing-function-docstring, invalid-name
14+
# pylint: disable=missing-function-docstring
1515

1616
import pytest
1717

@@ -25,25 +25,25 @@
2525

2626

2727
def test_adapters_017():
28-
A, B, C = bmat8.random(), BMat8(0), bmat8.one()
29-
right = ImageRightAction(point=A, element=A)
28+
a, b, c = bmat8.random(), BMat8(0), bmat8.one()
29+
right = ImageRightAction(point=a, element=a)
3030
# Point1, Point2, Element -> Point1 = Point2 ^ Element
31-
B = right(A, C)
32-
assert B == bmat8.row_space_basis(A)
31+
b = right(a, c)
32+
assert b == bmat8.row_space_basis(a)
3333

34-
B = right(C, A)
35-
assert B == bmat8.row_space_basis(A)
34+
b = right(c, a)
35+
assert b == bmat8.row_space_basis(a)
3636

37-
left = ImageLeftAction(point=A, element=A)
38-
B = left(A, C)
39-
assert B == bmat8.col_space_basis(A)
37+
left = ImageLeftAction(point=a, element=a)
38+
b = left(a, c)
39+
assert b == bmat8.col_space_basis(a)
4040

41-
B = left(C, A)
42-
assert B == bmat8.col_space_basis(A)
41+
b = left(c, a)
42+
assert b == bmat8.col_space_basis(a)
4343

44-
B = right(A, A)
45-
C = left(bmat8.transpose(A), bmat8.transpose(A))
46-
assert B == bmat8.transpose(C)
44+
b = right(a, a)
45+
c = left(bmat8.transpose(a), bmat8.transpose(a))
46+
assert b == bmat8.transpose(c)
4747

4848

4949
def test_image_right_action_pperm_pperm():

tests/test_bipart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This module contains some tests for bipartitions.
1111
"""
1212

13-
# pylint: disable=no-name-in-module, missing-function-docstring, invalid-name
13+
# pylint: disable=missing-function-docstring, invalid-name
1414

1515
from itertools import chain
1616

tests/test_bmat8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
arising from bmat8.*pp in libsemigroups.
1212
"""
1313

14-
# pylint: disable=no-name-in-module, missing-function-docstring, invalid-name
14+
# pylint: disable=missing-function-docstring
1515

1616
import pytest
1717
from libsemigroups_pybind11 import BMat8, LibsemigroupsError

tests/test_cong.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This file contains tests for Congruence from libsemigroups_pybind11.
1111
"""
1212

13-
# pylint: disable=no-name-in-module, missing-function-docstring, invalid-name
13+
# pylint: disable=missing-function-docstring
1414

1515
from datetime import timedelta
1616

tests/test_forest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# The full license is in the file LICENSE, distributed with this software.
88

9-
# pylint: disable=missing-function-docstring, redefined-outer-name
9+
# pylint: disable=missing-function-docstring
1010

1111
"""
1212
This module contains some tests for the libsemigroups_pybind11 functionality
@@ -18,13 +18,12 @@
1818
from libsemigroups_pybind11 import Forest, UNDEFINED
1919

2020

21-
@pytest.fixture
21+
@pytest.fixture(name="f")
2222
def forest_fixture():
2323
return Forest([UNDEFINED, 0, 1, 2, 3], [UNDEFINED, 0, 0, 0, 0])
2424

2525

26-
def test_forest_return_policy(forest_fixture):
27-
f = forest_fixture
26+
def test_forest_return_policy(f):
2827
assert f.add_nodes(2) is f
2928
assert f.init(2) is f
3029
assert f.labels() is not f.labels()

tests/test_froidure_pin.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# pylint: disable=no-name-in-module, missing-function-docstring
3-
# pylint: disable=missing-class-docstring, invalid-name, redefined-outer-name
42

53
# Copyright (c) 2021-2024 J. D. Mitchell
64
#
@@ -12,6 +10,8 @@
1210
This module contains some tests for FroidurePin
1311
"""
1412

13+
# pylint: disable=missing-function-docstring, invalid-name
14+
1515
from datetime import timedelta
1616
import pytest
1717

@@ -285,13 +285,13 @@ def check_froidure_pin_transf2(T):
285285
]
286286

287287

288-
@pytest.fixture
289-
def checks_for_generators():
288+
@pytest.fixture(name="checks_for_generators")
289+
def fixture_checks_for_generators():
290290
return (check_constructors,)
291291

292292

293-
@pytest.fixture
294-
def checks_for_froidure_pin():
293+
@pytest.fixture(name="checks_for_froidure_pin")
294+
def fixture_checks_for_froidure_pin():
295295
return (
296296
check_settings,
297297
check_mem_compare,

0 commit comments

Comments
 (0)