Skip to content

Commit 83b30af

Browse files
author
Release Manager
committed
sagemathgh-38788: Ruff e713 Using ruff to auto-fix all E713 codes Test for membership should be `not in` then activating this check in the linter ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. URL: sagemath#38788 Reported by: Frédéric Chapoton Reviewer(s): Vincent Macri
2 parents 350b92c + 181e960 commit 83b30af

File tree

34 files changed

+67
-67
lines changed

34 files changed

+67
-67
lines changed

.github/sync_labels.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ def actor_valid(self):
609609
for com in coms:
610610
for auth in com['authors']:
611611
login = auth['login']
612-
if not login in authors:
612+
if login not in authors:
613613
if not self.is_this_bot(login) and login != author:
614614
debug('PR %s has recent commit by %s' % (self._issue, login))
615615
authors.append(login)
@@ -746,7 +746,7 @@ def add_label(self, label):
746746
r"""
747747
Add the given label to the issue or PR.
748748
"""
749-
if not label in self.get_labels():
749+
if label not in self.get_labels():
750750
self.edit(label, '--add-label')
751751
info('Add label to %s: %s' % (self._issue, label))
752752

src/sage/coding/gabidulin_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def __init__(self, base_field, length, dimension, sub_field=None,
207207
if not len(evaluation_points) == length:
208208
raise ValueError("the number of evaluation points should be equal to the length of the code")
209209
for i in range(length):
210-
if not evaluation_points[i] in base_field:
210+
if evaluation_points[i] not in base_field:
211211
raise ValueError("evaluation point does not belong to the 'base field'")
212212
basis = self.matrix_form_of_vector(vector(evaluation_points))
213213
if basis.rank() != length:

src/sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def BM_all_minimal(vp, return_transformation=False, D=None):
590590
for M in all_M:
591591
new_map = mp.conjugate(M)
592592
new_map.normalize_coordinates()
593-
if not [new_map, M] in all_maps:
593+
if [new_map, M] not in all_maps:
594594
all_maps.append([new_map, M])
595595

596596
#Split into conjugacy classes

src/sage/dynamics/arithmetic_dynamics/projective_ds.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,7 @@ def parallel_function(morphism):
29352935
# Calling possible_periods for each prime in parallel
29362936
parallel_data = []
29372937
for q in primes(primebound[0], primebound[1] + 1):
2938-
if not (q in badprimes):
2938+
if q not in badprimes:
29392939
F = self.change_ring(GF(q))
29402940
parallel_data.append(((F,), {}))
29412941

@@ -6768,7 +6768,7 @@ def is_Lattes(self):
67686768
(crit_set, post_crit_set) = crit, list(post_crit)
67696769

67706770
# All Lattes maps have 3 or 4 post critical values
6771-
if not len(post_crit_set) in [3, 4]:
6771+
if len(post_crit_set) not in [3, 4]:
67726772
return False
67736773

67746774
f = F_crit.dehomogenize(1)[0]
@@ -7228,7 +7228,7 @@ def lift_to_rational_periodic(self, points_modp, B=None):
72287228
while not done and k <= n:
72297229
newP = self(newP)
72307230
if newP == P:
7231-
if not ([P, k] in good_points):
7231+
if [P, k] not in good_points:
72327232
good_points.append([newP, k])
72337233
done = True
72347234
k += 1
@@ -7499,7 +7499,7 @@ def all_periodic_points(self, **kwds):
74997499
pos_points = []
75007500
# check period, remove duplicates
75017501
for i in range(len(all_points)):
7502-
if all_points[i][1] in periods and not (all_points[i] in pos_points):
7502+
if all_points[i][1] in periods and all_points[i] not in pos_points:
75037503
pos_points.append(all_points[i])
75047504
periodic_points = DS.lift_to_rational_periodic(pos_points,B)
75057505
for p,n in periodic_points:
@@ -7594,7 +7594,7 @@ def all_rational_preimages(self, points):
75947594
P = points.pop()
75957595
preimages = self.rational_preimages(P)
75967596
for i in range(len(preimages)):
7597-
if not preimages[i] in preperiodic:
7597+
if preimages[i] not in preperiodic:
75987598
points.append(preimages[i])
75997599
preperiodic.add(preimages[i])
76007600
return list(preperiodic)
@@ -9073,7 +9073,7 @@ def is_newton(self, return_conjugation=False):
90739073
"""
90749074
if self.degree() == 1:
90759075
raise NotImplementedError("degree one Newton maps are trivial")
9076-
if not self.base_ring() in NumberFields():
9076+
if self.base_ring() not in NumberFields():
90779077
raise NotImplementedError("only implemented over number fields")
90789078
# check if Newton map
90799079
sigma_1 = self.sigma_invariants(1)

src/sage/functions/bessel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ def Bessel(*args, **kwds):
12281228
_type = kwds['typ']
12291229
else:
12301230
_type = 'J'
1231-
if not (_type in ['I', 'J', 'K', 'Y']):
1231+
if _type not in ['I', 'J', 'K', 'Y']:
12321232
raise ValueError("type must be one of I, J, K, Y")
12331233

12341234
# return the function

src/sage/games/hexad.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,15 @@ def find_hexad3(self, pts, x0, x1):
466466
L = set(pts)
467467
H = {x0, x1}
468468
for i in range(18):
469-
if (not (MINIMOG[0][2] in H) and L <= picture_set(self.picture21, self.square[i])):
469+
if (MINIMOG[0][2] not in H and L <= picture_set(self.picture21, self.square[i])):
470470
WHAT = ["square " + str(i), "picture " + str(MINIMOG[0][2])]
471471
H = H | picture_set(self.picture21, self.square[i])
472472
return list(H), WHAT
473-
if (not (MINIMOG[2][1] in H) and L <= picture_set(self.picture02, self.square[i])):
473+
if (MINIMOG[2][1] not in H and L <= picture_set(self.picture02, self.square[i])):
474474
WHAT = ["square " + str(i), "picture " + str(MINIMOG[2][1])]
475475
H = H | picture_set(self.picture02, self.square[i])
476476
return list(H), WHAT
477-
if (not (MINIMOG[0][0] in H) and L <= picture_set(self.picture00, self.square[i])):
477+
if (MINIMOG[0][0] not in H and L <= picture_set(self.picture00, self.square[i])):
478478
WHAT = ["square " + str(i), "picture " + str(MINIMOG[0][0])]
479479
H = H | picture_set(self.picture00, self.square[i])
480480
return list(H), WHAT

src/sage/geometry/hyperplane_arrangement/plot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,14 @@ def plot(hyperplane_arrangement, **kwds):
212212
if 'ranges' in kwds:
213213
ranges_set = True
214214
ranges = kwds.pop('ranges')
215-
if not type(ranges) in [list,tuple]: # ranges is a single number
215+
if type(ranges) not in [list,tuple]: # ranges is a single number
216216
ranges = [ranges] * N
217217
# So ranges is some type of list.
218218
elif dim == 2: # arrangement of lines in the plane
219-
if not type(ranges[0]) in [list,tuple]: # a single interval
219+
if type(ranges[0]) not in [list,tuple]: # a single interval
220220
ranges = [ranges] * N
221221
elif dim == 3: # arrangement of planes in 3-space
222-
if not type(ranges[0][0]) in [list,tuple]:
222+
if type(ranges[0][0]) not in [list,tuple]:
223223
ranges = [ranges] * N
224224
elif dim not in [2,3]: # ranges is not an option unless dim is 2 or 3
225225
ranges_set = False

src/sage/geometry/polyhedron/base5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2452,7 +2452,7 @@ def _test_lawrence(self, tester=None, **options):
24522452
if tester is None:
24532453
tester = self._tester(**options)
24542454

2455-
if self.backend() == 'normaliz' and not self.base_ring() in (ZZ, QQ):
2455+
if self.backend() == 'normaliz' and self.base_ring() not in (ZZ, QQ):
24562456
# Speeds up the doctest for significantly.
24572457
self = self.change_ring(self._internal_base_ring)
24582458

src/sage/graphs/digraph_generators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1657,7 +1657,7 @@ def RandomDirectedGNM(self, n, m, loops=False):
16571657
if is_dense:
16581658
for u in range(n):
16591659
for v in range(n):
1660-
if ((u != v) or loops) and (not (v in adj[u])):
1660+
if ((u != v) or loops) and (v not in adj[u]):
16611661
D.add_edge(u, v)
16621662

16631663
return D

src/sage/graphs/generators/classical_geometries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ def T2starGeneralizedQuadrangleGraph(q, dual=False, hyperoval=None, field=None,
11071107
raise RuntimeError("incorrect hyperoval size")
11081108
for L in Theta.blocks():
11091109
if set(L).issubset(Pi):
1110-
if not len(HO.intersection(L)) in [0, 2]:
1110+
if len(HO.intersection(L)) not in [0, 2]:
11111111
raise RuntimeError("incorrect hyperoval")
11121112

11131113
L = [[y for y in z if y not in HO]

0 commit comments

Comments
 (0)