#11943: The category graph should comply with Python's method resolution order
---------------------------+------------------------------------------------
Reporter: SimonKing | Owner: nthiery
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-4.7.3
Component: categories | Keywords: category graph, method resolution
order
Work_issues: | Upstream: N/A
Reviewer: | Author: Simon King
Merged: | Dependencies: #11900
---------------------------+------------------------------------------------
Changes (by newvalueoldvalue):
* status: new => needs_review
* dependencies: => #11900
* author: => Simon King
Comment:
Patch's up!
To my surprise, the change in the order of super categories was relatively
harmless. In few cases, a test involving all_super_categories had to
change.
I added a test `_test_category_graph` to the Test Suite of categories. By
that test, I found one bug in algebra_ideals, which I fixed. Hom
categories can not use the new test yet, since it tests the mro of the
parent class against the list of parent classes of all super categories -
which is fairly inconsistent for hom categories. That is already a "to
do", and should be part of the next category overhaule.
Apart from these small changes, all doc tests passed! In particular, I did
not need to change `super_categories` (except for algebra ideals): The
current category graph seems to be consistent!!
That was the good news.
The bad news is that we have a regression in the computation of
`all_super_categories`. With #11900, we have
{{{
sage: L = [Algebras(GF(p)) for p in prime_range(10000)]
sage: %time X = [C.all_super_categories() for C in L]
CPU times: user 0.74 s, sys: 0.01 s, total: 0.75 s
Wall time: 0.75 s
}}}
With the patches from here added, we only have
{{{
sage: L = [Algebras(GF(p)) for p in prime_range(10000)]
sage: %time X = [C.all_super_categories() for C in L]
CPU times: user 1.06 s, sys: 0.02 s, total: 1.07 s
Wall time: 1.08 s
}}}
I tried hard to make my C3 implementation as fast as possible in the range
we need: few lists (say, 4) of moderate length (not more than 60).
I think the performance should be improved. But a review can already be
started.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11943#comment:2>
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.