Skip to content

Commit 409d5b4

Browse files
committed
suggested details
1 parent 48ee57e commit 409d5b4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/sage/algebras/lie_conformal_algebras/lie_conformal_algebra_with_structure_coefs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,17 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None):
145145
Finite family {('L', 'L'): ((0, ((('L', 1), 1),)), (1, ((('L', 0), 2),)), (3, ((('C', 0), 1/2),)))}
146146
"""
147147
if parity is None:
148-
parity = (0,)*index_set.cardinality()
149-
index_to_parity = dict(zip(index_set,parity))
148+
parity = (0,) * index_set.cardinality()
149+
index_to_parity = dict(zip(index_set, parity))
150150
sc = {}
151-
#mypair has a pair of generators
151+
# mypair has a pair of generators
152152
for mypair in s_coeff.keys():
153-
#e.g. v = { 0: { (L,2):3, (G,3):1}, 1:{(L,1),2} }
153+
# e.g. v = { 0: { (L,2):3, (G,3):1}, 1:{(L,1),2} }
154154
v = s_coeff[mypair]
155155
key = tuple(mypair)
156156
vals = {}
157-
for l in v.keys():
158-
lth_product = {k:y for k,y in v[l].items() if y}
157+
for l in v:
158+
lth_product = {k: y for k, y in v[l].items() if y}
159159
if lth_product:
160160
vals[l] = lth_product
161161

@@ -175,7 +175,7 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None):
175175
parsgn = -1
176176
else:
177177
parsgn = 1
178-
maxpole = max(v.keys())
178+
maxpole = max(v)
179179
vals = {}
180180
for k in range(maxpole+1):
181181
kth_product = {}

src/sage/algebras/steenrod/steenrod_algebra.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ def coprod_list(t):
13061306
if basis == 'milnor':
13071307
if not self._generic:
13081308
left = coprod_list(t)
1309-
right = [[x-y for (x,y) in zip(t, m)] for m in left]
1309+
right = [[x - y for x, y in zip(t, m)] for m in left]
13101310
old = list(left)
13111311
left = []
13121312
# trim trailing zeros:
@@ -1320,14 +1320,14 @@ def coprod_list(t):
13201320
while a and a[-1] == 0:
13211321
a = a[:-1]
13221322
right.append(tuple(a))
1323-
tens = {}.fromkeys(zip(left, right), 1)
1323+
tens = dict.fromkeys(zip(left, right), 1)
13241324
return self.tensor_square()._from_dict(tens, coerce=True)
13251325
else: # p odd
13261326
from sage.combinat.permutation import Permutation
13271327
from .steenrod_algebra_misc import convert_perm
13281328
from sage.sets.set import Set
13291329
left_p = coprod_list(t[1])
1330-
right_p = [[x-y for (x,y) in zip(t[1], m)] for m in left_p]
1330+
right_p = [[x - y for x, y in zip(t[1], m)] for m in left_p]
13311331
old = list(left_p)
13321332
left_p = []
13331333
# trim trailing zeros:

src/sage/algebras/weyl_algebra.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def repr_dx(k):
213213
return ''
214214
denom = ' '.join('\\partial {}{}'.format(latex(g), exp(e))
215215
for e, g in zip(k, gens) if e != 0)
216-
return ''.join(' \\frac{{\\partial{}}}{{{}}}'.format(exp(total), denom) )
216+
return ''.join(' \\frac{{\\partial{}}}{{{}}}'.format(exp(total), denom))
217217
repr_x = latex
218218
else:
219219
def exp(e):
@@ -313,7 +313,7 @@ def half_term(mon, polynomial):
313313
return '1'
314314
ret = ' '.join('{}{}'.format(latex(R.gen(i)), exp(power)) if polynomial
315315
else '\\partial {}{}'.format(latex(R.gen(i)), exp(power))
316-
for i,power in enumerate(mon) if power > 0)
316+
for i, power in enumerate(mon) if power > 0)
317317
if not polynomial:
318318
return '\\frac{{\\partial{}}}{{{}}}'.format(exp(total), ret)
319319
return ret
@@ -811,8 +811,8 @@ class options(GlobalOptions):
811811
NAME = 'DifferentialWeylAlgebra'
812812
module = 'sage.algebras.weyl_algebra'
813813
factor_representation = {'default': False,
814-
'description': 'Controls whether to factor the differentials out or not in the output representations',
815-
'checker': lambda x: x in [True, False]}
814+
'description': 'Controls whether to factor the differentials out or not in the output representations',
815+
'checker': lambda x: x in [True, False]}
816816

817817
def _element_constructor_(self, x):
818818
"""

0 commit comments

Comments
 (0)