Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 4eea459

Browse files
author
Release Manager
committed
Trac #33486: fix indentation (E111) in some pyx files
URL: https://trac.sagemath.org/33486 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Matthias Koeppe
2 parents 273836b + 801c068 commit 4eea459

24 files changed

+132
-129
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=f82b40417a8c050b2ea0b6e15ef7291801325432
3-
md5=89cd19b31c6b6da6f6a0964de5fb960f
4-
cksum=1750781409
2+
sha1=acd2166b712d910e83d89f9cbc28d786632b6be8
3+
md5=dd823be0c5983a7f9afeb371cf651547
4+
cksum=1397772811
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6b5920b4aa88af53cb01b487bfe7eb0868a447fe
1+
509be3f5aaf552403e34ed35d936c72a26e6c5ab

src/sage/arith/multi_modular.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ cdef class MultiModularBasis_base(object):
116116
"""
117117
sig_free(self.moduli)
118118
for i in range(self.n):
119-
mpz_clear(self.partial_products[i])
119+
mpz_clear(self.partial_products[i])
120120
sig_free(self.partial_products)
121121
sig_free(self.C)
122122
mpz_clear(self.product)
@@ -487,9 +487,9 @@ cdef class MultiModularBasis_base(object):
487487
count = self.n * mpz_sizeinbase(height, 2) / mpz_sizeinbase(self.partial_products[self.n-1], 2) # an estimate
488488
count = max(min(count, self.n), 1)
489489
while count > 1 and mpz_cmp(height, self.partial_products[count-1]) < 0:
490-
count -= 1
490+
count -= 1
491491
while mpz_cmp(height, self.partial_products[count-1]) > 0:
492-
count += 1
492+
count += 1
493493

494494
return count
495495

src/sage/categories/action.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ cdef class Action(Functor):
304304
return S
305305

306306
def codomain(self):
307-
return self.underlying_set()
307+
return self.underlying_set()
308308

309309
def domain(self):
310310
return self.underlying_set()
@@ -454,7 +454,7 @@ cdef class PrecomposedAction(Action):
454454
if right_precomposition is not None:
455455
rco = right_precomposition._codomain
456456
if rco is not right:
457-
right_precomposition = homset.Hom(rco, right).natural_map() * right_precomposition
457+
right_precomposition = homset.Hom(rco, right).natural_map() * right_precomposition
458458
right = right_precomposition.domain()
459459
if action._is_left:
460460
Action.__init__(self, left, US, 1)

src/sage/combinat/degree_sequences.pyx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -441,24 +441,25 @@ cdef init(int n):
441441
return sequences
442442

443443
cdef inline add_seq():
444-
"""
445-
This function is called whenever a sequence is found.
444+
"""
445+
This function is called whenever a sequence is found.
446+
447+
Build the degree sequence corresponding to the current state of the
448+
algorithm and adds it to the sequences list.
449+
"""
450+
global sequences
451+
global N
452+
global seq
446453

447-
Build the degree sequence corresponding to the current state of the
448-
algorithm and adds it to the sequences list.
449-
"""
450-
global sequences
451-
global N
452-
global seq
454+
cdef list s = []
455+
cdef int i, j
453456

454-
cdef list s = []
455-
cdef int i, j
457+
for N > i >= 0:
458+
for 0 <= j < seq[i]:
459+
s.append(i)
456460

457-
for N > i >= 0:
458-
for 0<= j < seq[i]:
459-
s.append(i)
461+
sequences.append(s)
460462

461-
sequences.append(s)
462463

463464
cdef void enum(int k, int M):
464465
r"""

src/sage/ext/fast_callable.pyx

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,55 +1483,56 @@ cdef class ExpressionChoice(Expression):
14831483
repr(self._iffalse))
14841484

14851485
cpdef _expression_binop_helper(s, o, op):
1486-
r"""
1487-
Make an Expression for (s op o). Either s or o (or both) must already
1488-
be an expression.
1489-
1490-
EXAMPLES::
1491-
1492-
sage: from sage.ext.fast_callable import _expression_binop_helper, ExpressionTreeBuilder
1493-
sage: var('x,y')
1494-
(x, y)
1495-
sage: etb = ExpressionTreeBuilder(vars=(x,y))
1496-
sage: x = etb(x)
1497-
1498-
Now x is an Expression, but y is not. Still, all the following
1499-
cases work::
1500-
1501-
sage: _expression_binop_helper(x, x, operator.add)
1502-
add(v_0, v_0)
1503-
sage: _expression_binop_helper(x, y, operator.add)
1504-
add(v_0, v_1)
1505-
sage: _expression_binop_helper(y, x, operator.add)
1506-
add(v_1, v_0)
1507-
1508-
"""
1509-
# The Cython way of handling operator overloading on cdef classes
1510-
# (which is inherited from Python) is quite annoying. Inside the
1511-
# code for a binary operator, you know that either the first or
1512-
# second argument (or both) is a member of your class, but you
1513-
# don't know which.
1514-
1515-
# If there is an arithmetic operator between an Expression and
1516-
# a non-Expression, I want to convert the non-Expression into
1517-
# an Expression. But to do that, I need the ExpressionTreeBuilder
1518-
# from the Expression.
1519-
1520-
cdef Expression self
1521-
cdef Expression other
1522-
1523-
if not isinstance(o, Expression):
1524-
self = s
1525-
other = self._etb(o)
1526-
elif not isinstance(s, Expression):
1527-
other = o
1528-
self = other._etb(s)
1529-
else:
1530-
self = s
1531-
other = o
1532-
assert self._etb is other._etb
1533-
1534-
return ExpressionCall(self._etb, op, [self, other])
1486+
r"""
1487+
Make an Expression for (s op o). Either s or o (or both) must already
1488+
be an expression.
1489+
1490+
EXAMPLES::
1491+
1492+
sage: from sage.ext.fast_callable import _expression_binop_helper, ExpressionTreeBuilder
1493+
sage: var('x,y')
1494+
(x, y)
1495+
sage: etb = ExpressionTreeBuilder(vars=(x,y))
1496+
sage: x = etb(x)
1497+
1498+
Now x is an Expression, but y is not. Still, all the following
1499+
cases work::
1500+
1501+
sage: _expression_binop_helper(x, x, operator.add)
1502+
add(v_0, v_0)
1503+
sage: _expression_binop_helper(x, y, operator.add)
1504+
add(v_0, v_1)
1505+
sage: _expression_binop_helper(y, x, operator.add)
1506+
add(v_1, v_0)
1507+
1508+
"""
1509+
# The Cython way of handling operator overloading on cdef classes
1510+
# (which is inherited from Python) is quite annoying. Inside the
1511+
# code for a binary operator, you know that either the first or
1512+
# second argument (or both) is a member of your class, but you
1513+
# don't know which.
1514+
1515+
# If there is an arithmetic operator between an Expression and
1516+
# a non-Expression, I want to convert the non-Expression into
1517+
# an Expression. But to do that, I need the ExpressionTreeBuilder
1518+
# from the Expression.
1519+
1520+
cdef Expression self
1521+
cdef Expression other
1522+
1523+
if not isinstance(o, Expression):
1524+
self = s
1525+
other = self._etb(o)
1526+
elif not isinstance(s, Expression):
1527+
other = o
1528+
self = other._etb(s)
1529+
else:
1530+
self = s
1531+
other = o
1532+
assert self._etb is other._etb
1533+
1534+
return ExpressionCall(self._etb, op, [self, other])
1535+
15351536

15361537
class IntegerPowerFunction(object):
15371538
r"""

src/sage/graphs/bliss.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,15 +861,16 @@ cdef Graph *bliss_graph(G, partition, vert2int, int2vert):
861861
vert2int[v] = i
862862
int2vert[i] = v
863863

864-
for x,y in G.edge_iterator(labels=False):
865-
g.add_edge(vert2int[x], vert2int[y])
864+
for x, y in G.edge_iterator(labels=False):
865+
g.add_edge(vert2int[x], vert2int[y])
866866

867867
if partition:
868868
for i in range(1, len(partition)):
869869
for v in partition[i]:
870870
g.change_color(vert2int[v], i)
871871
return g
872872

873+
873874
cdef Digraph *bliss_digraph(G, partition, vert2int, int2vert):
874875
r"""
875876
Return a bliss copy of a digraph G

src/sage/graphs/distances_all_pairs.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ def is_distance_regular(G, parameters=False):
591591
for u in range(n):
592592
for v in range(n):
593593
if u == v:
594-
continue
594+
continue
595595

596596
d = distance_matrix[u * n + v]
597597
if d == infinity:

src/sage/graphs/graph_coloring.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ def b_coloring(g, k, value_only=True, solver=None, verbose=0,
11901190

11911191
# a color class is used if and only if it has one b-vertex
11921192
for i in range(k):
1193-
p.add_constraint(p.sum(b[w,i] for w in g) - is_used[i], min=0, max=0)
1193+
p.add_constraint(p.sum(b[w,i] for w in g) - is_used[i], min=0, max=0)
11941194

11951195

11961196
# We want to maximize the number of used colors

src/sage/graphs/strongly_regular_db.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ def is_unitary_dual_polar(int v,int k,int l,int mu):
13411341
if p**t != q or t % 2:
13421342
return
13431343
if (r < 0 and q != -r - 1) or (s < 0 and q != -s - 1):
1344-
return
1344+
return
13451345
t //= 2
13461346
# we have correct mu, negative eigenvalue, and q=p^(2t)
13471347
if (v == (q**2*p**t + 1)*(q*p**t + 1) and

0 commit comments

Comments
 (0)