#11935: Make parent/element classes independent of base rings
---------------------------+------------------------------------------------
   Reporter:  SimonKing    |          Owner:  nthiery                           
   
       Type:  enhancement  |         Status:  needs_review                      
   
   Priority:  major        |      Milestone:  sage-4.8                          
   
  Component:  categories   |       Keywords:  parent class, element class, 
category
Work_issues:               |       Upstream:  N/A                               
   
   Reviewer:               |         Author:  Simon King                        
   
     Merged:               |   Dependencies:  #9138 #11900 #11943               
   
---------------------------+------------------------------------------------
Changes (by SimonKing):

  * dependencies:  #9138 #11900 #11943 #11999 => #9138 #11900 #11943


Comment:

 I have updated my patch according to what we have discussed.

  * I added a subclass `CategoryWithParameters` of the `Category` class. Of
 course, if you have a shorter yet more descriptive name, I can change
 that. I believe `CategoryWithClassesFromBases` is too long and not clearer
 than `CategoryWithParameters`. And I think `CategoryEnsemble` is not clear
 either.
  * Both `Category_over_base`, `JoinCategory` and `Bimodules` inherit from
 the new class.
  * Pickling is by weak construction: A parent class P is pickled by
 `getattr, (C,'parent_class')`, where C is any category such that
 C.parent_class is P at the time of pickling. We had discussed advantages
 and disadvantages of this and other approaches.

 Using the new class, the patch becomes independent of #11999. Of course, I
 still think that #11999 is a nice addition, but your suggestion to use a
 sub-class is better.

 Replying to [comment:33 SimonKing]:
 > I will certainly test both approaches. But if I remember correctly what
 I did yesterday, the difference between "pickling by weak construction" or
 "default pickling" for join categories was 6% in the infamous elliptic
 curve benchmark.

 Here I was mistaken: With the new patch, the benchmark becomes
 {{{
 sage: %time L = EllipticCurve('960d1').prove_BSD()
 CPU times: user 2.87 s, sys: 0.05 s, total: 2.92 s
 Wall time: 3.10 s
 }}}
 and this is as fast as by using default pickling for parent classes of
 join categories.

 Apply trac11935_weak_pickling_by_construction_rel11943.patch

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11935#comment:34>
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.

Reply via email to