#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 #11999        
   
---------------------------+------------------------------------------------

Comment(by SimonKing):

 Hi Nicolas,

 Replying to [comment:32 nthiery]:
 > Replying to [comment:31 SimonKing]:
 >     class CategoryWithClassesFromBases(Category):  # TODO: find a better
 name

 Perhaps `CategoryEnsemble`? The name is short and refers to the fact that
 the members of an ensemble (such as all categories of algebras over
 fields) are sufficiently similar that they share important features (such
 as their parent class).

 Or (slightly longer) `CategoryWithParameters`? Again, if you have
 parameters (such as one or two base rings) then still certain important
 features may not depend on the parameters. Or  `ParametrizedCategory`, but
 I think you prefer if the name starts with the word "Category", isn't it?

 >     class JoinCategory(CategoryWithClassesFromBases): ...

 I think join categories should have their own parent class. Reason:

 The parent/element classes of a category ensemble are pickled by a weak
 form of "pickling by construction": If C1,C2,... belong to an ensemble of
 categories that share their parent class, then that class will be pickled
 as getattr(C,'parent_class'), where C is any member of the ensemble.

 But I think that `JoinCategory` should ''not'' use that "pickling by weak
 construction". Reason: For `JoinCategory`, the "pickling by weak
 construction" is equivalent to the default pickling of dynamic classes
 (which is: the class is determined by name, bases, and potentially a new
 class such as `ParentMethods`, which is empty in the case of a
 `JoinCategory`). Hence, it would be a waste of time to construct the
 pickle data for the `JoinCategory` ''while they are created''.

 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.

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