Skip to content

Commit 45b27f7

Browse files
committed
suggested details
1 parent 1740b79 commit 45b27f7

File tree

3 files changed

+28
-29
lines changed

3 files changed

+28
-29
lines changed

src/sage/combinat/composition_tableau.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(self, parent, t):
120120

121121
CombinatorialElement.__init__(self, parent, t)
122122

123-
def _repr_diagram(self):
123+
def _repr_diagram(self) -> str:
124124
r"""
125125
Return a string representation of ``self`` as an array.
126126
@@ -133,7 +133,7 @@ def _repr_diagram(self):
133133
4 4
134134
"""
135135
return '\n'.join("".join("%3s" % str(x) for x in row)
136-
for row in self)
136+
for row in self)
137137

138138
def __call__(self, *cell):
139139
r"""

src/sage/combinat/diagram_algebras.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4558,59 +4558,59 @@ def is_planar(sp):
45584558
sage: da.is_planar( da.to_set_partition([[1,-1],[2,-2]]))
45594559
True
45604560
"""
4561-
#Singletons don't affect planarity
4561+
# Singletons don't affect planarity
45624562
to_consider = [x for x in map(list, sp) if len(x) > 1]
45634563
n = len(to_consider)
45644564

45654565
for i in range(n):
4566-
#Get the positive and negative entries of this part
4566+
# Get the positive and negative entries of this part
45674567
ap = [x for x in to_consider[i] if x > 0]
45684568
an = [abs(x) for x in to_consider[i] if x < 0]
45694569

4570-
#Check if a includes numbers in both the top and bottom rows
4570+
# Check if a includes numbers in both the top and bottom rows
45714571
if ap and an:
45724572
for j in range(n):
45734573
if i == j:
45744574
continue
4575-
#Get the positive and negative entries of this part
4575+
# Get the positive and negative entries of this part
45764576
bp = [x for x in to_consider[j] if x > 0]
45774577
bn = [abs(x) for x in to_consider[j] if x < 0]
45784578

4579-
#Skip the ones that don't involve numbers in both
4580-
#the bottom and top rows
4579+
# Skip the ones that don't involve numbers in both
4580+
# the bottom and top rows
45814581
if not bn or not bp:
45824582
continue
45834583

4584-
#Make sure that if min(bp) > max(ap)
4585-
#then min(bn) > max(an)
4584+
# Make sure that if min(bp) > max(ap)
4585+
# then min(bn) > max(an)
45864586
if max(bp) > max(ap):
45874587
if min(bn) < min(an):
45884588
return False
45894589

4590-
#Go through the bottom and top rows
4590+
# Go through the bottom and top rows
45914591
for row in [ap, an]:
45924592
if len(row) > 1:
45934593
row.sort()
45944594
for s in range(len(row)-1):
45954595
if row[s] + 1 == row[s+1]:
4596-
#No gap, continue on
4596+
# No gap, continue on
45974597
continue
45984598

45994599
rng = list(range(row[s] + 1, row[s+1]))
46004600

4601-
#Go through and make sure any parts that
4602-
#contain numbers in this range are completely
4603-
#contained in this range
4601+
# Go through and make sure any parts that
4602+
# contain numbers in this range are completely
4603+
# contained in this range
46044604
for j in range(n):
46054605
if i == j:
46064606
continue
46074607

4608-
#Make sure we make the numbers negative again
4609-
#if we are in the bottom row
4608+
# Make sure we make the numbers negative again
4609+
# if we are in the bottom row
46104610
if row is ap:
46114611
sr = set(rng)
46124612
else:
4613-
sr = set(-1*x for x in rng)
4613+
sr = set(-x for x in rng)
46144614

46154615
sj = set(to_consider[j])
46164616
intersection = sr.intersection(sj)
@@ -4773,12 +4773,11 @@ def to_set_partition(l, k=None):
47734773
[{-1, 1}, {-2, 3}, {2}, {-4, 4}, {-5, 5}, {-3}]
47744774
"""
47754775
if k is None:
4776-
if l == []:
4776+
if not l:
47774777
return []
4778-
else:
4779-
k = max( max( map(abs, x) ) for x in l )
4778+
k = max(max(map(abs, x)) for x in l)
47804779

4781-
to_be_added = set( list(range(1, ceil(k+1))) + [-1*x for x in range(1, ceil(k+1))] )
4780+
to_be_added = set(list(range(1, ceil(k+1))) + [-x for x in range(1, ceil(k+1))])
47824781

47834782
sp = []
47844783
for part in l:
@@ -4790,7 +4789,7 @@ def to_set_partition(l, k=None):
47904789
i = to_be_added.pop()
47914790
if -i in to_be_added:
47924791
to_be_added.remove(-i)
4793-
sp.append(set([i,-i]))
4792+
sp.append(set([i, -i]))
47944793
else:
47954794
sp.append(set([i]))
47964795

src/sage/combinat/sf/sfa.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
- Darij Grinberg (2013) Sym over rings that are not characteristic 0
197197
198198
"""
199-
#*****************************************************************************
199+
# ****************************************************************************
200200
# Copyright (C) 2007 Mike Hansen <[email protected]>
201201
# 2012 Anne Schilling <anne at math.ucdavis.edu>
202202
# 2012 Mike Zabrocki <[email protected]>
@@ -210,8 +210,8 @@
210210
#
211211
# The full text of the GPL is available at:
212212
#
213-
# http://www.gnu.org/licenses/
214-
#*****************************************************************************
213+
# https://www.gnu.org/licenses/
214+
# ****************************************************************************
215215
from sage.misc.cachefunc import cached_method
216216
from sage.rings.integer_ring import ZZ
217217
from sage.rings.rational_field import QQ
@@ -306,7 +306,7 @@ def is_SymmetricFunction(x):
306306
return isinstance(x, SymmetricFunctionAlgebra_generic.Element)
307307

308308
#####################################################################
309-
## Bases categories
309+
# Bases categories
310310

311311

312312
from sage.categories.realizations import Category_realization_of_parent
@@ -4620,7 +4620,7 @@ def internal_coproduct(self):
46204620
@cached_function
46214621
def hnimage(n):
46224622
return result_parent.sum(tensor([parent(s(lam)), parent(s(lam))])
4623-
for lam in Partitions(n))
4623+
for lam in Partitions(n))
46244624
for lam, a in h(self):
46254625
result += a * prod(hnimage(i) for i in lam)
46264626
return result
@@ -5588,7 +5588,7 @@ def _is_positive(self, s):
55885588
True
55895589
"""
55905590
s_self = s(self)
5591-
return all( _nonnegative_coefficients(c) for c in s_self.coefficients() )
5591+
return all(_nonnegative_coefficients(c) for c in s_self.coefficients())
55925592

55935593
def degree(self):
55945594
r"""

0 commit comments

Comments
 (0)