Skip to content

Commit d75ffed

Browse files
committed
some pep8 cleanup in rigged-configurations
1 parent 2f426a1 commit d75ffed

17 files changed

+155
-155
lines changed

src/sage/combinat/rigged_configurations/bij_abstract_class.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- Travis Scrimshaw (2011-04-15): Initial version
1818
"""
1919

20-
#*****************************************************************************
20+
# ****************************************************************************
2121
# Copyright (C) 2011, 2012 Travis Scrimshaw <[email protected]>
2222
#
2323
# Distributed under the terms of the GNU General Public License (GPL)
@@ -29,8 +29,8 @@
2929
#
3030
# The full text of the GPL is available at:
3131
#
32-
# http://www.gnu.org/licenses/
33-
#*****************************************************************************
32+
# https://www.gnu.org/licenses/
33+
# ****************************************************************************
3434

3535
from copy import deepcopy
3636
from sage.misc.abstract_method import abstract_method
@@ -120,19 +120,19 @@ def run(self, verbose=False):
120120
"""
121121
if verbose:
122122
from sage.combinat.rigged_configurations.tensor_product_kr_tableaux_element \
123-
import TensorProductOfKirillovReshetikhinTableauxElement
123+
import TensorProductOfKirillovReshetikhinTableauxElement
124124

125125
for cur_crystal in reversed(self.tp_krt):
126126
target = cur_crystal.parent()._r
127127
# Iterate through the columns
128128
for col_number, cur_column in enumerate(reversed(cur_crystal.to_array(False))):
129-
self.cur_path.insert(0, []) # Prepend an empty list
129+
self.cur_path.insert(0, []) # Prepend an empty list
130130

131131
self.cur_dims.insert(0, [0, 1])
132132

133133
for letter in reversed(cur_column):
134134
self.cur_dims[0][0] = self._next_index(self.cur_dims[0][0], target)
135-
val = letter.value # Convert from a CrystalOfLetter to an Integer
135+
val = letter.value # Convert from a CrystalOfLetter to an Integer
136136

137137
if verbose:
138138
print("====================")
@@ -142,7 +142,7 @@ def run(self, verbose=False):
142142
print("--------------------\n")
143143

144144
# Build the next state
145-
self.cur_path[0].insert(0, [letter]) # Prepend the value
145+
self.cur_path[0].insert(0, [letter]) # Prepend the value
146146
self.next_state(val)
147147

148148
# If we've split off a column, we need to merge the current column
@@ -166,7 +166,7 @@ def run(self, verbose=False):
166166
for a in range(self.n):
167167
self._update_vacancy_nums(a)
168168

169-
self.ret_rig_con.set_immutable() # Return it to immutable
169+
self.ret_rig_con.set_immutable() # Return it to immutable
170170
return self.ret_rig_con
171171

172172
@abstract_method
@@ -220,7 +220,7 @@ def _update_vacancy_nums(self, a):
220220
"""
221221
# Check to make sure we have a valid index (currently removed)
222222
# If the current tableau is empty, there is nothing to do
223-
if not self.ret_rig_con[a]: # Check to see if we have vacancy numbers
223+
if not self.ret_rig_con[a]: # Check to see if we have vacancy numbers
224224
return
225225

226226
# Setup the first block
@@ -268,7 +268,7 @@ def _update_partition_values(self, a):
268268
pos = 0
269269
width = rigged_partition[index]
270270
val = rigged_partition.rigging[index]
271-
for i in reversed(range(index-1)):
271+
for i in reversed(range(index - 1)):
272272
if rigged_partition[i] > width or rigged_partition.rigging[i] >= val:
273273
pos = i + 1
274274
break
@@ -333,7 +333,7 @@ def __init__(self, RC_element):
333333
# This is a dummy edge to start the process
334334
cp = RC_element.__copy__()
335335
cp.set_immutable()
336-
self._graph = [ [[], (cp, 0)] ]
336+
self._graph = [[[], (cp, 0)]]
337337

338338
def __eq__(self, rhs):
339339
r"""
@@ -414,7 +414,7 @@ def run(self, verbose=False, build_graph=False):
414414
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions], use_vacancy_numbers=True)
415415
self._graph.append([self._graph[-1][1], (y, len(self._graph)), 'ls'])
416416

417-
while self.cur_dims[0][0]: # > 0:
417+
while self.cur_dims[0][0]: # > 0:
418418
if verbose:
419419
print("====================")
420420
print(repr(self.rigged_con.parent()(*self.cur_partitions, use_vacancy_numbers=True)))
@@ -427,16 +427,16 @@ def run(self, verbose=False, build_graph=False):
427427
b = self.next_state(ht)
428428

429429
# Make sure we have a crystal letter
430-
ret_crystal_path[-1].append(letters(b)) # Append the rank
430+
ret_crystal_path[-1].append(letters(b)) # Append the rank
431431

432432
if build_graph:
433433
y = self.rigged_con.parent()(*[x._clone() for x in self.cur_partitions], use_vacancy_numbers=True)
434434
self._graph.append([self._graph[-1][1], (y, len(self._graph)), letters(b)])
435435

436-
self.cur_dims.pop(0) # Pop off the leading column
436+
self.cur_dims.pop(0) # Pop off the leading column
437437

438438
if build_graph:
439-
self._graph.pop(0) # Remove the dummy at the start
439+
self._graph.pop(0) # Remove the dummy at the start
440440
from sage.graphs.digraph import DiGraph
441441
from sage.graphs.dot2tex_utils import have_dot2tex
442442
self._graph = DiGraph(self._graph, format="list_of_edges")

src/sage/combinat/rigged_configurations/bij_infinity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ def _call_(self, x):
175175
if ct.type() == 'D':
176176
lam[-2] = max(lam[-2], lam[-1])
177177
lam.pop()
178-
l = sum([ [[r+1,1]]*v for r,v in enumerate(lam[:-1]) ], [])
178+
l = sum([[[r+1, 1]]*v for r, v in enumerate(lam[:-1])], [])
179179
n = len(I)
180-
l = l + sum([ [[n,1], [n-1,1]] for k in range(lam[-1])], [])
180+
l = l + sum([[[n,1], [n-1,1]] for k in range(lam[-1])], [])
181181
else:
182182
if ct.type() == 'B':
183183
lam[-1] *= 2
184-
l = sum([ [[r,1]]*lam[i] for i,r in enumerate(I) ], [])
184+
l = sum([[[r, 1]]*lam[i] for i, r in enumerate(I)], [])
185185

186186
RC = RiggedConfigurations(ct.affine(), reversed(l))
187187
elt = RC(x)

src/sage/combinat/rigged_configurations/bij_type_A.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
sage: TestSuite(bijection).run()
2222
"""
2323

24-
#*****************************************************************************
24+
# ****************************************************************************
2525
# Copyright (C) 2011, 2012 Travis Scrimshaw <[email protected]>
2626
#
2727
# Distributed under the terms of the GNU General Public License (GPL)
@@ -33,8 +33,8 @@
3333
#
3434
# The full text of the GPL is available at:
3535
#
36-
# http://www.gnu.org/licenses/
37-
#*****************************************************************************
36+
# https://www.gnu.org/licenses/
37+
# ****************************************************************************
3838

3939
from sage.combinat.rigged_configurations.bij_abstract_class import KRTToRCBijectionAbstract
4040
from sage.combinat.rigged_configurations.bij_abstract_class import RCToKRTBijectionAbstract
@@ -122,7 +122,7 @@ def next_state(self, height):
122122
sage: bijection.next_state(1)
123123
5
124124
"""
125-
height -= 1 # indexing
125+
height -= 1 # indexing
126126
n = self.n
127127
ell = [None] * n
128128
b = None
@@ -158,4 +158,4 @@ def next_state(self, height):
158158
if row_num is not None:
159159
self.cur_partitions[n - 1].rigging[row_num] = self.cur_partitions[n - 1].vacancy_numbers[row_num]
160160

161-
return(b)
161+
return b

src/sage/combinat/rigged_configurations/bij_type_A2_dual.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
sage: TestSuite(bijection).run()
2121
"""
2222

23-
#*****************************************************************************
23+
# ****************************************************************************
2424
# Copyright (C) 2012 Travis Scrimshaw <[email protected]>
2525
#
2626
# Distributed under the terms of the GNU General Public License (GPL)
@@ -32,8 +32,8 @@
3232
#
3333
# The full text of the GPL is available at:
3434
#
35-
# http://www.gnu.org/licenses/
36-
#*****************************************************************************
35+
# https://www.gnu.org/licenses/
36+
# ****************************************************************************
3737

3838
from sage.combinat.rigged_configurations.bij_type_C import KRTToRCBijectionTypeC
3939
from sage.combinat.rigged_configurations.bij_type_C import RCToKRTBijectionTypeC
@@ -155,7 +155,7 @@ def next_state(self, val):
155155
else:
156156
j = i - 1
157157
while j >= 0 and partition._list[j] <= max_width + 2:
158-
partition.rigging[j+1] = partition.rigging[j] # Shuffle it along
158+
partition.rigging[j+1] = partition.rigging[j] # Shuffle it along
159159
j -= 1
160160
partition._list.pop(i)
161161
partition._list.insert(j+1, max_width + 2)
@@ -219,7 +219,7 @@ def next_state(self, height):
219219
sage: bijection.next_state(2)
220220
-1
221221
"""
222-
height -= 1 # indexing
222+
height -= 1 # indexing
223223
n = self.n
224224
ell = [None] * (2*n)
225225
case_S = [False] * n
@@ -333,4 +333,4 @@ def next_state(self, height):
333333
else:
334334
self.cur_partitions[n-1].rigging[row_num_bar_next] = self.cur_partitions[n-1].vacancy_numbers[row_num_bar_next]
335335

336-
return(b)
336+
return b

src/sage/combinat/rigged_configurations/bij_type_A2_even.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
sage: TestSuite(bijection).run()
2121
"""
2222

23-
#*****************************************************************************
23+
# ****************************************************************************
2424
# Copyright (C) 2012 Travis Scrimshaw <[email protected]>
2525
#
2626
# Distributed under the terms of the GNU General Public License (GPL)
@@ -32,8 +32,8 @@
3232
#
3333
# The full text of the GPL is available at:
3434
#
35-
# http://www.gnu.org/licenses/
36-
#*****************************************************************************
35+
# https://www.gnu.org/licenses/
36+
# ****************************************************************************
3737

3838
from sage.combinat.rigged_configurations.bij_type_A import KRTToRCBijectionTypeA
3939
from sage.combinat.rigged_configurations.bij_type_C import KRTToRCBijectionTypeC
@@ -139,7 +139,7 @@ def next_state(self, height):
139139
sage: bijection.next_state(2)
140140
-1
141141
"""
142-
height -= 1 # indexing
142+
height -= 1 # indexing
143143
n = self.n
144144
ell = [None] * (2*n)
145145
case_S = [False] * n
@@ -213,4 +213,4 @@ def next_state(self, height):
213213
if row_num_bar is not None:
214214
self.cur_partitions[n-1].rigging[row_num_bar] = self.cur_partitions[n-1].vacancy_numbers[row_num_bar]
215215

216-
return(b)
216+
return b

src/sage/combinat/rigged_configurations/bij_type_A2_odd.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
sage: TestSuite(bijection).run()
2121
"""
2222

23-
#*****************************************************************************
23+
# ****************************************************************************
2424
# Copyright (C) 2012 Travis Scrimshaw <[email protected]>
2525
#
2626
# Distributed under the terms of the GNU General Public License (GPL)
@@ -32,8 +32,8 @@
3232
#
3333
# The full text of the GPL is available at:
3434
#
35-
# http://www.gnu.org/licenses/
36-
#*****************************************************************************
35+
# https://www.gnu.org/licenses/
36+
# ****************************************************************************
3737

3838
from sage.combinat.rigged_configurations.bij_type_A import KRTToRCBijectionTypeA
3939
from sage.combinat.rigged_configurations.bij_type_A import RCToKRTBijectionTypeA
@@ -126,7 +126,7 @@ def next_state(self, height):
126126
sage: bijection.next_state(1)
127127
-2
128128
"""
129-
height -= 1 # indexing
129+
height -= 1 # indexing
130130
n = self.n
131131
ell = [None] * (2*n)
132132
b = None
@@ -194,4 +194,4 @@ def next_state(self, height):
194194
if ret_row_next is not None:
195195
self.cur_partitions[n-1].rigging[ret_row_next] = self.cur_partitions[n-1].vacancy_numbers[ret_row_next]
196196

197-
return(b)
197+
return b

0 commit comments

Comments
 (0)