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

Commit

Permalink
remove unnecessary code leftover from merge, and remove unneccesary i…
Browse files Browse the repository at this point in the history
…mport detected by pyflakes
  • Loading branch information
mantepse committed Aug 31, 2022
1 parent dafdcb4 commit 731072a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 75 deletions.
1 change: 0 additions & 1 deletion src/sage/combinat/sf/sfa.py
Original file line number Diff line number Diff line change
Expand Up @@ -4977,7 +4977,6 @@ def frobenius(self, n):
# then convert back.
parent = self.parent()
m = parent.realization_of().monomial()
from sage.combinat.partition import Partition
dct = {lam.stretch(n): coeff for lam, coeff in m(self)}
result_in_m_basis = m._from_dict(dct)
return parent(result_in_m_basis)
Expand Down
74 changes: 0 additions & 74 deletions src/sage/rings/lazy_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4428,80 +4428,6 @@ def revert(self):
plethystic_inverse = revert
compositional_inverse = revert

def _format_series(self, formatter, format_strings=False):
r"""
Return nonzero ``self`` formatted by ``formatter``.
TESTS::
sage: h = SymmetricFunctions(ZZ).h()
sage: e = SymmetricFunctions(ZZ).e()
sage: L = LazySymmetricFunctions(tensor([h, e]))
sage: f = L(lambda n: sum(tensor([h[k], e[n-k]]) for k in range(n+1)))
sage: f._format_series(repr)
'(h[]#e[])
+ (h[]#e[1]+h[1]#e[])
+ (h[]#e[2]+h[1]#e[1]+h[2]#e[])
+ (h[]#e[3]+h[1]#e[2]+h[2]#e[1]+h[3]#e[])
+ (h[]#e[4]+h[1]#e[3]+h[2]#e[2]+h[3]#e[1]+h[4]#e[])
+ (h[]#e[5]+h[1]#e[4]+h[2]#e[3]+h[3]#e[2]+h[4]#e[1]+h[5]#e[])
+ (h[]#e[6]+h[1]#e[5]+h[2]#e[4]+h[3]#e[3]+h[4]#e[2]+h[5]#e[1]+h[6]#e[])
+ O^7'
"""
P = self.parent()
cs = self._coeff_stream
v = cs._approximate_order
if isinstance(cs, Stream_exact):
if not cs._constant:
m = cs._degree
else:
m = cs._degree + P.options.constant_length
else:
m = v + P.options.display_length

atomic_repr = P._internal_poly_ring.base_ring()._repr_option('element_is_atomic')
mons = [P._monomial(self[i], i) for i in range(v, m) if self[i]]
if not isinstance(cs, Stream_exact) or cs._constant:
if P._internal_poly_ring.base_ring() is P.base_ring():
bigO = ["O(%s)" % P._monomial(1, m)]
else:
bigO = ["O^%s" % m]
else:
bigO = []

from sage.misc.latex import latex
from sage.typeset.unicode_art import unicode_art
from sage.typeset.ascii_art import ascii_art
from sage.misc.repr import repr_lincomb
from sage.typeset.symbols import ascii_left_parenthesis, ascii_right_parenthesis
from sage.typeset.symbols import unicode_left_parenthesis, unicode_right_parenthesis
if formatter == repr:
poly = repr_lincomb([(1, m) for m in mons + bigO], strip_one=True)
elif formatter == latex:
poly = repr_lincomb([(1, m) for m in mons + bigO], is_latex=True, strip_one=True)
elif formatter == ascii_art:
if atomic_repr:
poly = ascii_art(*(mons + bigO), sep = " + ")
else:
def parenthesize(m):
a = ascii_art(m)
h = a.height()
return ascii_art(ascii_left_parenthesis.character_art(h),
a, ascii_right_parenthesis.character_art(h))
poly = ascii_art(*([parenthesize(m) for m in mons] + bigO), sep = " + ")
elif formatter == unicode_art:
if atomic_repr:
poly = unicode_art(*(mons + bigO), sep = " + ")
else:
def parenthesize(m):
a = unicode_art(m)
h = a.height()
return unicode_art(unicode_left_parenthesis.character_art(h),
a, unicode_right_parenthesis.character_art(h))
poly = unicode_art(*([parenthesize(m) for m in mons] + bigO), sep = " + ")

return poly

def symmetric_function(self, degree=None):
r"""
Return ``self`` as a symmetric function if ``self`` is actually so.
Expand Down

0 comments on commit 731072a

Please sign in to comment.