[Sage] #13433: Fix bad handling of base ring in lazy power series

1 view
Skip to first unread message

Sage

unread,
Sep 6, 2012, 5:33:22 AM9/6/12
to sage...@googlegroups.com
#13433: Fix bad handling of base ring in lazy power series
-----------------------------+----------------------------------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: new
Priority: major | Milestone: sage-5.4
Component: combinatorics | Keywords: LazyPowerSeries
Work issues: | Report Upstream: N/A
Reviewers: | Authors: Florent Hivert
Merged in: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------------------------
Currently
{{{
sage: R = LazyPowerSeriesRing(QQ)
sage: type(R.gen().coefficient(0))
<type 'sage.rings.rational.Rational'>
sage: type(R.gen().coefficient(1))
<type 'int'>
sage: type(R.gen().coefficient(2))
<type 'int'>
}}}
it should be always {{{Rational}}}

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, and MATLAB

Sage

unread,
Sep 6, 2012, 6:50:05 AM9/6/12
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
-----------------------------------------------+----------------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: new
Priority: major | Milestone: sage-5.4
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
-----------------------------------------------+----------------------------
Changes (by hivert):

* cc: SimonKing (added)
* keywords: LazyPowerSeries => LazyPowerSeries, categories


Comment:

The patch is not yet ready for review !

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:1>

Sage

unread,
Apr 24, 2013, 11:36:07 AM4/24/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
-----------------------------------------------+----------------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: new
Priority: major | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
-----------------------------------------------+----------------------------
Description changed by hivert:

Old description:

> Currently
> {{{
> sage: R = LazyPowerSeriesRing(QQ)
> sage: type(R.gen().coefficient(0))
> <type 'sage.rings.rational.Rational'>
> sage: type(R.gen().coefficient(1))
> <type 'int'>
> sage: type(R.gen().coefficient(2))
> <type 'int'>
> }}}
> it should be always {{{Rational}}}

New description:

Currently
{{{
sage: R = LazyPowerSeriesRing(QQ)
sage: type(R.gen().coefficient(0))
<type 'sage.rings.rational.Rational'>
sage: type(R.gen().coefficient(1))
<type 'int'>
sage: type(R.gen().coefficient(2))
<type 'int'>
}}}
it should be always {{{Rational}}}

I also fixed the following bug:
{{{
sage: from sage.combinat.species.series import LazyPowerSeriesRing
sage: L = LazyPowerSeriesRing(QQ)
sage: g = L.gen(); z = L.zero()
sage: s = z+g; s
Uninitialized lazy power series
sage: s.coefficients(10)
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
sage: s
Uninitialized lazy power series
}}}
It should be:
{{{
sage: s.coefficients(10)
[0, 1, 0, 0, 0, 0, 0, 0, 0, 0]
sage: s
x + O(x^10)
}}}

--

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:2>

Sage

unread,
Apr 24, 2013, 11:37:42 AM4/24/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
-----------------------------------------------+----------------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
-----------------------------------------------+----------------------------
Changes (by hivert):

* status: new => needs_review


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:3>

Sage

unread,
Apr 25, 2013, 5:40:23 AM4/25/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
--------------------------------------------------------+-------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------------+-------------------
Changes (by hivert):

* cc: chapoton (added)
* keywords: LazyPowerSeries, categories => LazyPowerSeries, categories,
Species


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:4>

Sage

unread,
May 8, 2013, 11:56:04 AM5/8/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
--------------------------------------------------------+-------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.10
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------------+-------------------

Comment (by nthiery):

Salut Florent,

There are some failing tests:
{{{
sage -t sage/combinat/tutorial.py # 5 doctests failed
sage -t sage/tests/french_book/polynomes.py # 7 doctests failed
}}}

Could you fix those or move the patch down the queue?

Thanks,
Nicolas

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:5>

Sage

unread,
Jun 17, 2013, 4:27:15 AM6/17/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
--------------------------------------------------------+-------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------------+-------------------

Comment (by hivert):

Fixed !

Florent

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:6>

Sage

unread,
Jun 17, 2013, 5:42:59 AM6/17/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
--------------------------------------------------------+-------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------------+-------------------
Changes (by darij):

* cc: darij (added)


--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:7>

Sage

unread,
Jun 17, 2013, 11:36:05 AM6/17/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
----------------------------------------------------------------+-----------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species, days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
----------------------------------------------------------------+-----------
Changes (by hivert):

* keywords: LazyPowerSeries, categories, Species => LazyPowerSeries,
categories, Species, days49


Comment:

Fixed a multiline doctest to silence the patchbot. Ready for review.

Florent

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:8>

Sage

unread,
Jun 17, 2013, 6:28:56 PM6/17/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
----------------------------------------------------------------+-----------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species, days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
----------------------------------------------------------------+-----------

Comment (by darij):

Any chance to get docstrings on _sum_generator_gen and/or sum_generator?
Andrew and me are wondering what precisely these functions do in
http://trac.sagemath.org/sage_trac/ticket/14542 . Thank you!

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:9>

Sage

unread,
Jun 18, 2013, 4:43:23 AM6/18/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
----------------------------------------------------------------+-----------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species, days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
----------------------------------------------------------------+-----------

Comment (by nthiery):

I have just been through the path, and it looks good to go.

Just one thing: using the new syntax for example continuations. And since
the whole file is touched anyway, we might as well do this change
everywhere.

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:10>

Sage

unread,
Jul 16, 2013, 3:11:45 PM7/16/13
to sage...@googlegroups.com
#13433: Lazy power series: fix bad handling of base ring and categorification
----------------------------------------------------------------+-----------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.11
Component: combinatorics | Resolution:
Keywords: LazyPowerSeries, categories, Species, days49 | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Florent Hivert | Merged in:
Dependencies: | Stopgaps:
----------------------------------------------------------------+-----------

Comment (by darij):

There is a doctest failing, see
http://patchbot.sagemath.org/log/13433/Fedora/18/x86_64/3.9.5-201.fc18.x86_64/desktop/2013-07-13%2021:47:59%20+0100?short
. One way to fix it is to replace the {{{_div_}}} method of the
{{{CycleIndexSeries}}} class by a {{{__div__}}} method, since I don't
think that class belongs to any category which has a division method. On
the other hand, this might not be what you want.

Ceterus censeo, {{{_sum_generator_gen}}} and {{{sum_generator}}} still
need to be documented...

--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13433#comment:11>

Reply all
Reply to author
Forward
0 new messages