Skip to content

Commit 15b0405

Browse files
committed
Trac #21319: fixup due to changes in dependencies
1 parent 1ead378 commit 15b0405

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/sage/combinat/k_regular_sequence.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
from .recognizable_series import RecognizableSeries
9898
from .recognizable_series import RecognizableSeriesSpace
9999
from sage.misc.cachefunc import cached_method
100-
from six import iteritems
101100

102101

103102
def pad_right(T, length, zero=0):
@@ -409,7 +408,7 @@ def subsequence(self, a, b, minimize=True):
409408

410409
if a == 0:
411410
return sum(c_j * self[b_j] * self.parent().one_hadamard()
412-
for b_j, c_j in iteritems(b))
411+
for b_j, c_j in b.items())
413412
elif a == 1 and len(b) == 1 and zero in b:
414413
return b[zero] * self
415414
elif a < 0:
@@ -457,7 +456,7 @@ def mu_line(r, i, c):
457456
for r in A),
458457
sum(c_j * vector(
459458
pad_right(pad(tuple(self.left), b_j), ndim, zero=zero))
460-
for b_j, c_j in iteritems(b)),
459+
for b_j, c_j in b.items()),
461460
vector(sum((tuple(self.__getitem__(c, multiply_left=False))
462461
if c >= 0 else dim*(zero,)
463462
for c in kernel), tuple())))
@@ -640,7 +639,7 @@ def _pickle_kRegularSequenceSpace(k, coefficients, category):
640639
sage: Seq2 = kRegularSequenceSpace(2, ZZ)
641640
sage: from sage.combinat.k_regular_sequence import _pickle_kRegularSequenceSpace
642641
sage: _pickle_kRegularSequenceSpace(
643-
....: Seq2.k, Seq2.coefficients(), Seq2.category())
642+
....: Seq2.k, Seq2.coefficient_ring(), Seq2.category())
644643
Space of 2-regular sequences over Integer Ring
645644
"""
646645
return kRegularSequenceSpace(k, coefficients, category=category)
@@ -723,6 +722,7 @@ def __init__(self, k, *args, **kwds):
723722
running ._test_an_element() . . . pass
724723
running ._test_cardinality() . . . pass
725724
running ._test_category() . . . pass
725+
running ._test_construction() . . . pass
726726
running ._test_elements() . . .
727727
Running the test suite of self.an_element()
728728
running ._test_category() . . . pass
@@ -762,7 +762,7 @@ def __reduce__(self):
762762
Space of 2-regular sequences over Integer Ring
763763
"""
764764
return _pickle_kRegularSequenceSpace, \
765-
(self.k, self.coefficients(), self.category())
765+
(self.k, self.coefficient_ring(), self.category())
766766

767767
def _repr_(self):
768768
r"""

src/sage/combinat/recognizable_series.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def immutable(m):
385385
return m
386386

387387
if isinstance(mu, dict):
388-
mu = dict((a, immutable(M)) for a, M in iteritems(mu))
388+
mu = dict((a, immutable(M)) for a, M in mu.items())
389389
mu = Family(mu)
390390

391391
if not mu.is_finite():
@@ -875,7 +875,7 @@ def __eq__(self, other):
875875
sage: Z1 = Rec((Matrix([[1, 0], [0, 1]]), Matrix([[1, 0], [0, 1]])),
876876
....: left=vector([0, 1]), right=vector([1, 0]))
877877
sage: Z1
878-
0
878+
0 + ...
879879
sage: Z2 = Rec((Matrix([[0, 0], [0, 0]]), Matrix([[0, 0], [0, 0]])),
880880
....: left=vector([0, 1]), right=vector([1, 0]))
881881
sage: Z2
@@ -1411,7 +1411,7 @@ def _pickle_RecognizableSeriesSpace(coefficients, indices, category):
14111411
sage: Rec = RecognizableSeriesSpace(ZZ, [0, 1])
14121412
sage: from sage.combinat.recognizable_series import _pickle_RecognizableSeriesSpace
14131413
sage: _pickle_RecognizableSeriesSpace(
1414-
....: Rec.coefficients(), Rec.indices(), Rec.category())
1414+
....: Rec.coefficient_ring(), Rec.indices(), Rec.category())
14151415
Space of recognizable series on {0, 1} with coefficients in Integer Ring
14161416
"""
14171417
return RecognizableSeriesSpace(coefficients, indices=indices, category=category)
@@ -1588,6 +1588,7 @@ def __init__(self, coefficient_ring, indices, category):
15881588
running ._test_an_element() . . . pass
15891589
running ._test_cardinality() . . . pass
15901590
running ._test_category() . . . pass
1591+
running ._test_construction() . . . pass
15911592
running ._test_elements() . . .
15921593
Running the test suite of self.an_element()
15931594
running ._test_category() . . . pass
@@ -1623,7 +1624,7 @@ def __reduce__(self):
16231624
Space of recognizable series on {0, 1} with coefficients in Integer Ring
16241625
"""
16251626
return _pickle_RecognizableSeriesSpace, \
1626-
(self.coefficients(), self.indices(), self.category())
1627+
(self.coefficient_ring(), self.indices(), self.category())
16271628

16281629

16291630
def alphabet(self):
@@ -1710,9 +1711,9 @@ def _an_element_(self):
17101711
"""
17111712
from sage.matrix.constructor import Matrix
17121713
from sage.modules.free_module_element import vector
1713-
z = self.coefficients().zero()
1714-
o = self.coefficients().one()
1715-
e = self.coefficients().an_element()
1714+
z = self.coefficient_ring().zero()
1715+
o = self.coefficient_ring().one()
1716+
e = self.coefficient_ring().an_element()
17161717
return self(list(Matrix([[o, z], [i*o, o]])
17171718
for i, _ in enumerate(self.alphabet())),
17181719
vector([z, e]), right=vector([e, z]))
@@ -1733,25 +1734,24 @@ def some_elements(self):
17331734
sage: tuple(RecognizableSeriesSpace(ZZ, [0, 1]).some_elements())
17341735
([1] + [01] + [10] + 2*[11] + [001] + [010]
17351736
+ 2*[011] + [100] + 2*[101] + 2*[110] + ...,
1736-
[] + [0] + [1] + [00] + [01] + [10]
1737-
+ [11] + [000] + [001] + [010] + ...,
1738-
0,
1739-
-2*[] + 2*[0] - 4*[1] - 2*[00] + 4*[01] + 4*[10]
1740-
- 8*[11] + 2*[000] - 4*[001] - 4*[010] + ...,
1741-
[] + [0] + 2*[1] + [00] + 2*[01] + [10]
1742-
+ 4*[11] + [000] + 2*[001] + [010] + ...,
1743-
2*[] + 5*[0] + 11*[1] + 8*[00] + 14*[01] + 14*[10]
1744-
+ 20*[11] + 11*[000] + 17*[001] + 17*[010] + ...,
1737+
[] + [1] + [11] + [111] + [1111] + [11111] + [111111] + ...,
1738+
[] + [0] + [1] + [00] + [10] + [11]
1739+
+ [000] - 1*[001] + [100] + [110] + ...,
1740+
2*[] - 1*[1] + 2*[10] - 1*[101]
1741+
+ 2*[1010] - 1*[10101] + 2*[101010] + ...,
1742+
[] + [1] + 6*[00] + [11] - 39*[000] + 5*[001] + 6*[100] + [111]
1743+
+ 288*[0000] - 33*[0001] + ...,
1744+
-5*[] + ...,
17451745
...
1746-
[] + [0] + 10*[1] + [00] + 10*[01] + [10]
1747-
+ 100*[11] + [000] + 10*[001] + [010] + ...)
1746+
210*[] + ...,
1747+
2210*[] - 170*[0] + 170*[1] + ...)
17481748
"""
17491749
from itertools import count, islice
17501750
from sage.matrix.matrix_space import MatrixSpace
17511751
from sage.modules.free_module import FreeModule
17521752
yield self.an_element()
17531753

1754-
C = self.coefficients()
1754+
C = self.coefficient_ring()
17551755
some_elements_base = iter(C.some_elements())
17561756
k = len(self.alphabet())
17571757
for dim in range(1, 11):

0 commit comments

Comments
 (0)