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

Commit

Permalink
Trac #26805: Fix combinat/rigged_configuration module ...
Browse files Browse the repository at this point in the history
... for python3.

workaround the "TypeError: unsupported format string" of Sage's Rational
type problem and fix two comparison problem (int with NoneType)
  • Loading branch information
Vincent Klein committed Dec 4, 2018
1 parent d45ef02 commit bbb1dc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def e(self, a):
else:
# Update the vacancy numbers and the rigging
for i in range(len(new_vac_nums)):
if new_list[i] < k:
if k is not None and new_list[i] < k:
break

new_vac_nums[i] += M[a,b]
Expand Down Expand Up @@ -651,7 +651,7 @@ def _generate_partition_e(self, a, b, k):
# Update the vacancy numbers and the rigging
value = self.parent()._cartan_matrix[b,a]
for i in range(len(new_vac_nums)):
if new_list[i] < k:
if k is not None and new_list[i] < k:
break

new_vac_nums[i] += value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ cdef class RiggedPartition(SageObject):
ret_str = ""
vac_num_width = max(len(str(vac_num)) for vac_num in self.vacancy_numbers)
for i, val in itr:
ret_str += ("{:>" + str(vac_num_width) + "}").format(self.vacancy_numbers[i])
ret_str += ("{:>" + str(vac_num_width) + "}").format(str(self.vacancy_numbers[i]))
ret_str += "[ ]"*val
ret_str += str(self.rigging[i])
ret_str += "\n"
Expand Down

0 comments on commit bbb1dc1

Please sign in to comment.