Skip to content

Commit 5c9ee29

Browse files
author
Release Manager
committed
gh-35720: fix the linter and add more checks <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description this is fixing, once again, the just-recently broken linter <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [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 accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35720 Reported by: Frédéric Chapoton Reviewer(s): Matthias Köppe
2 parents 6d1cb7e + 0552f74 commit 5c9ee29

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

src/sage/algebras/commutative_dga.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3886,9 +3886,8 @@ class CohomologyClass(SageObject, CachedRepresentation):
38863886
sage: CohomologyClass(x^2+2*y*z, A)
38873887
[2*y*z + x^2]
38883888
3889-
38903889
TESTS:
3891-
3890+
38923891
In order for the cache to not confuse objects with the same representation,
38933892
we can pass the parent of the representative as a parameter::
38943893

src/sage/algebras/lie_algebras/affine_lie_algebra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,4 +1211,4 @@ def __iter__(self):
12111211
for r in self._roots:
12121212
yield P((r, i))
12131213
for r in self._ac:
1214-
yield P((r, i))
1214+
yield P((r, i))

src/sage/knots/link.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3652,7 +3652,6 @@ def delta(u, v):
36523652
ims += sum(line(a[0], **kwargs) for a in im)
36533653
return image
36543654

3655-
36563655
def _markov_move_cmp(self, braid):
36573656
r"""
36583657
Return whether ``self`` can be transformed to the closure of ``braid``
@@ -4120,7 +4119,6 @@ def answer_list(l):
41204119

41214120
raise NotImplementedError('this link cannot be uniquely determined%s' %non_unique_hint)
41224121

4123-
41244122
self_m = self.mirror_image()
41254123
ls, proved_s = self._knotinfo_matching_list()
41264124
lm, proved_m = self_m._knotinfo_matching_list()
@@ -4147,18 +4145,18 @@ def answer_list(l):
41474145
cr = len(self.pd_code())
41484146
if self.is_knot() and cr > 12:
41494147
# we cannot not be sure if this link is recorded in the KnotInfo database
4150-
raise NotImplementedError('this knot having more than 12 crossings cannot be%s determined%s' %uniq_txt)
4148+
raise NotImplementedError('this knot having more than 12 crossings cannot be%s determined%s' % uniq_txt)
41514149

41524150
if not self.is_knot() and cr > 11:
41534151
# we cannot not be sure if this link is recorded in the KnotInfo database
4154-
raise NotImplementedError('this link having more than 11 crossings cannot be%s determined%s' %uniq_txt)
4152+
raise NotImplementedError('this link having more than 11 crossings cannot be%s determined%s' % uniq_txt)
41554153

41564154
H = self.homfly_polynomial(normalization='vz')
41574155

41584156
if sum(exp for f, exp in H.factor()) > 1:
41594157
# we cannot be sure if this is a prime link (see the example for the connected
41604158
# sum of K4_1 and K5_2 in the doctest of :meth:`_knotinfo_matching_list`)
4161-
raise NotImplementedError('this (possibly non prime) link cannot be%s determined%s' %uniq_txt)
4159+
raise NotImplementedError('this (possibly non prime) link cannot be%s determined%s' % uniq_txt)
41624160

41634161
if not l:
41644162
from sage.features.databases import DatabaseKnotInfo
@@ -4167,7 +4165,6 @@ def answer_list(l):
41674165

41684166
return answer_list(l)
41694167

4170-
41714168
def is_isotopic(self, other):
41724169
r"""
41734170
Check whether ``self`` is isotopic to ``other``.

src/sage/rings/polynomial/multi_polynomial_element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,13 +2119,13 @@ def factor(self, proof=None):
21192119
# try to use univariate factoring
21202120
try:
21212121
F = self.univariate_polynomial().factor()
2122-
return Factorization([(R(f),m) for f,m in F], unit=F.unit())
2122+
return Factorization([(R(f), m) for f, m in F], unit=F.unit())
21232123
except TypeError:
21242124
pass
21252125

21262126
base_ring = self.base_ring()
21272127
if base_ring.is_finite():
2128-
if base_ring.characteristic() > 1<<29:
2128+
if base_ring.characteristic() > 1 << 29:
21292129
raise NotImplementedError("Factorization of multivariate polynomials over prime fields with characteristic > 2^29 is not implemented.")
21302130

21312131
if proof is None:

src/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ description =
126126
# W605: invalid escape sequence ‘x’
127127
# See https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
128128
deps = pycodestyle
129-
commands = pycodestyle --select E111,E211,E271,E303,E306,E401,E502,E701,E702,E703,E714,W291,W293,W391,W605,E711,E712,E713,E721,E722 {posargs:{toxinidir}/sage/}
130-
pycodestyle --select E111,E306,E401,E703,W293,W391,W605,E712,E713,E714,E721,E722 --filename *.pyx {posargs:{toxinidir}/sage/}
129+
commands = pycodestyle --select E111,E21,E227,E271,E303,E306,E401,E502,E701,E702,E703,E71,E72,W291,W293,W391,W605 {posargs:{toxinidir}/sage/}
130+
pycodestyle --select E111,E306,E401,E703,W29,W391,W605,E712,E713,E714,E721,E722 --filename *.pyx {posargs:{toxinidir}/sage/}
131131
132132
[pycodestyle]
133133
max-line-length = 160

0 commit comments

Comments
 (0)