Skip to content

Commit

Permalink
fix the broken linters
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Apr 2, 2023
1 parent 5dd80aa commit 07a1135
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
25 changes: 8 additions & 17 deletions src/sage/combinat/crystals/key_crystals.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from sage.misc.cachefunc import cached_method
from collections.abc import Sequence


class KeyTableau(ClonableArray):
r"""
A key tableau.
Expand All @@ -53,19 +54,16 @@ def check(self):

def _repr_(self):
r"""
EXAMPLES::
Return a string representation.
"""
return repr([list(row) for row in self])

def _repr_diagram(self):
r"""
Return a string representation of the diagram of ``self``.
EXAMPLES::
"""
if not self:
return '0'
ret = ""
width = max(len(repr(val)) for row in self for val in row)
base = f"{{:^{width}}}"
return "\n".join("|" + " ".join(base.format(val) for val in row)
Expand All @@ -83,8 +81,6 @@ def _latex_(self):
def _ascii_art_(self):
r"""
Return an ascii art representation of ``self``.
EXAMPLES::
"""
from sage.typeset.ascii_art import AsciiArt
return AsciiArt(self._repr_diagram().splitlines())
Expand All @@ -103,7 +99,7 @@ def _unicode_art_(self):
vl = unicodedata.lookup('BOX DRAWINGS LIGHT VERTICAL AND LEFT')
table = [[None]*(self.cols-len(row)) + row for row in reversed(self)]
ret = []
for i,row in enumerate(ascii_art_table(table, use_unicode=True).splitlines()):
for i, row in enumerate(ascii_art_table(table, use_unicode=True).splitlines()):
if row[-1] == " ":
if i % 2 == 0:
ret.append(row[:-1] + vl)
Expand Down Expand Up @@ -164,8 +160,6 @@ def e(self, i, by_tableau=False):
r"""
Return the application of the Kashiwara raising operator
`e_i` on ``self``.
EXAMPLES::
"""
P = self.parent()
n = P._cartan_type.rank()
Expand Down Expand Up @@ -219,8 +213,6 @@ def f(self, i, by_tableau=False):
r"""
Return the application of the Kashiwara lowering operator
`f_i` on ``self``.
EXAMPLES::
"""
P = self.parent()
n = P._cartan_type.rank()
Expand Down Expand Up @@ -250,7 +242,6 @@ def f(self, i, by_tableau=False):
data = tuple(map(tuple, data))
return P.element_class(P, data, check=False)


# f_1
# 1
# 55511
Expand Down Expand Up @@ -294,11 +285,11 @@ def weight(self, root_lattice=False):
-2*alpha[0] - 3*alpha[1] - 5*alpha[2] - 3*alpha[3]
"""
P = self.parent().weight_lattice_realization()
wt = [P.base_ring().zero()] * len(L.basis())
wt = [P.base_ring().zero()] * len(P.basis())
for row in self:
for val in row:
wt[val-1] += 1
return L.from_vector(wt, coerce=False)
return P.from_vector(wt, coerce=False)

def epsilon(self, i):
r"""
Expand Down Expand Up @@ -515,7 +506,7 @@ def from_tableau(self, T):
n = self._cartan_type.rank() + 2
T = ([n - val for val in col] for col in reversed(T.conjugate()))

for j in range(self._width-1,-1,-1):
for j in range(self._width-1, -1, -1):
col = next(T)
for ind, row in enumerate(data):
if len(row) <= j:
Expand All @@ -525,7 +516,7 @@ def from_tableau(self, T):
row[j] = col.pop()
else:
# Necessarily there is an entry to the right
for i in range(len(col)-1,-1,-1):
for i in range(len(col)-1, -1, -1):
if col[i] >= row[j+1]:
row[j] = col.pop(i)
break
Expand All @@ -544,4 +535,4 @@ def shape(self):
"""
Return the shape of ``self``.
"""
return self._shape
return self._shape
4 changes: 2 additions & 2 deletions src/sage/schemes/elliptic_curves/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def is_HCP(f, check_monic_irreducible=True):
# Guarantees 4*p > |D| for fundamental D under GRH
p = pmin-1
n = 0
from sage.arith.all import next_prime
from sage.arith.misc import next_prime
while True:
p = next_prime(p)
n += 1
Expand Down Expand Up @@ -315,7 +315,7 @@ def OrderClassNumber(D0,h0,f):
return h0
ps = f.prime_divisors()
from sage.misc.misc_c import prod
from sage.arith.all import kronecker_symbol
from sage.arith.misc import kronecker as kronecker_symbol
n = (f // prod(ps)) * prod(p-kronecker_symbol(D0,p) for p in ps)
if D0 == -3:
#assert h0 == 1 and n%3==0
Expand Down

0 comments on commit 07a1135

Please sign in to comment.