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

Commit

Permalink
Strengthening Laurent series conversion.
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Scrimshaw committed Sep 26, 2021
1 parent b2f4cee commit 2b40d39
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/sage/rings/lazy_series_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.lazy_series import (LazyModuleElement,
LazyCauchyProductSeries,
LazyLaurentSeries,
LazyDirichletSeries)
from sage.structure.global_options import GlobalOptions
Expand Down Expand Up @@ -253,6 +254,13 @@ def _element_constructor_(self, x=None, valuation=None, degree=None, constant=No
...
ValueError: constant may only be specified if the degree is specified
sage: D = LazyDirichletSeriesRing(ZZ, 't')
sage: m = D(moebius)
sage: L(m)
Traceback (most recent call last):
...
ValueError: unable to convert ... into Lazy Laurent Series Ring ...
We support the old input format for ``constant``::
sage: f = L(lambda i: i, valuation=-3, constant=-1, degree=3)
Expand All @@ -263,11 +271,6 @@ def _element_constructor_(self, x=None, valuation=None, degree=None, constant=No
sage: f == g
True
sage: D = LazyDirichletSeriesRing(ZZ, 't')
sage: m = D(moebius)
sage: L(m)
z - z^2 - z^3 - z^5 + z^6 - z^7 + O(z^8)
.. TODO::
Add a method to change the sparse/dense implementation.
Expand Down Expand Up @@ -318,7 +321,7 @@ def _element_constructor_(self, x=None, valuation=None, degree=None, constant=No
return self.element_class(self, coeff_stream)

# Handle when it is a lazy series
if isinstance(x, LazyModuleElement):
if isinstance(x, LazyCauchyProductSeries):
if x._coeff_stream._is_sparse is not self._sparse:
# TODO: Implement a way to make a self._sparse copy
raise NotImplementedError("cannot convert between sparse and dense")
Expand Down

0 comments on commit 2b40d39

Please sign in to comment.