#9138: Categories for polynomial rings
--------------------------+-------------------------------------------------
Reporter: jbandlow | Owner: nthiery
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7
Component: categories | Keywords: introspection, categories for rings
Author: Simon King | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Changes (by SimonKing):
* keywords: introspection, categories => introspection, categories for
rings
* status: needs_work => needs_review
* work_issues: Fix conversion maps that return None =>
Old description:
> Introspection is failing on polynomial rings:
> {{{
> sage: R.<x> = QQ[]
> sage: R.su<tab>
> R.sum R.summation
> R.summation_from_element_class_add
> sage: R.sum?
> Object `R.sum` not found.
> sage: R.sum()
> ---------------------------------------------------------------------------
> AttributeError Traceback (most recent call
> last)
> }}}
>
> This is because polynomial rings do not yet set their category properly:
> {{{
> sage: QQ[x]._test_category()
> ------------------------------------------------------------
> Traceback (most recent call last):
> ...
> AssertionError: category of self improperly initialized
> }}}
>
> See http://groups.google.com/group/sage-
> devel/browse_thread/thread/4780192a11a8b591 for more discussion.
New description:
Introspection is failing on polynomial rings:
{{{
sage: R.<x> = QQ[]
sage: R.su<tab>
R.sum R.summation
R.summation_from_element_class_add
sage: R.sum?
Object `R.sum` not found.
sage: R.sum()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
}}}
This is because polynomial rings do not yet set their category properly:
{{{
sage: QQ[x]._test_category()
------------------------------------------------------------
Traceback (most recent call last):
...
AssertionError: category of self improperly initialized
}}}
See http://groups.google.com/group/sage-
devel/browse_thread/thread/4780192a11a8b591 for more discussion.
Depends on #9944
--
Comment:
I think now we are ready for review.
Long tests passed for me.
By the way, the long tests made me fix another bug. Namely, in the
`__setstate__` method of `CategoryObject`, the existing category was
overridden by the value found in the pickle. If you do so for the ration
field, than afterwards its category is not the category of quotient fields
but of rings. Result: The pickle jar broke.
Solution: If the category in the pickle is None, then `self._category`
will be preserved. Otherwise, it will be the join of `self._category` (if
not None) with the category found in the pickle.
I don't know whether you agree with the second part of that solution. But
I think the first part should be clear.
Also, I added some `TestSuite` tests for various flavours of polynomial
rings.
For the patch bot:
Depends on #9944
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9138#comment:21>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.