#11935: Make parent/element classes independent of base rings
-----------------------------------------------------------------+----------
       Reporter:  SimonKing                                      |         
Owner:  nthiery     
           Type:  enhancement                                    |        
Status:  needs_review
       Priority:  major                                          |     
Milestone:  sage-5.0    
      Component:  categories                                     |    
Resolution:              
       Keywords:  parent class, element class, category          |   Work 
issues:              
Report Upstream:  N/A                                            |     
Reviewers:              
        Authors:  Simon King                                     |     Merged 
in:              
   Dependencies:  #9138, #11900, #11943, #12875, #12876, #12877  |      
Stopgaps:              
-----------------------------------------------------------------+----------
Changes (by nthiery):

 * cc: sage-combinat (added)
  * dependencies:  #9138 #11900 #11943 => #9138, #11900, #11943, #12875,
                   #12876, #12877


Old description:

> At #11900 and [http://groups.google.com/group/sage-combinat-
> devel/browse_thread/thread/99c74827d704e677 sage-combinat-devel], as well
> as in some comments in sage/categories/category.py, the idea was
> discussed to make, for example,
> `Algebras(GF(3)).parent_class==Algebras(GF(5)).parent_class` - hence,
> make the parent/element classes as independent from the base of a
> category as possible.
>
> __Apply__
>
>  * [attachment:trac11935_weak_pickling_by_construction_rel11943.patch]

New description:

 At #11900 and [http://groups.google.com/group/sage-combinat-
 devel/browse_thread/thread/99c74827d704e677 sage-combinat-devel], as well
 as in some comments in sage/categories/category.py, the idea was discussed
 to make, for example,
 `Algebras(GF(3)).parent_class==Algebras(GF(5)).parent_class` - hence, make
 the parent/element classes as independent from the base of a category as
 possible.

 This is implemented in this patch by introducing an abstract class
 CategoryWithParameters which uses pickling by "weak construction" for
 its element and parent classes. In the process, this patch also:

 - Adds a method Category._make_named_class providing a unified way to
   create parent and element classes (and later on morphism classes)
 - Extends the interface of dynamic_class to customize caching and pickling



 __Apply__

  * [attachment:trac11935_weak_pickling_by_construction_rel11943-nt.patch]

--

Comment:

 Hi Simon,

 I reworked the patch by adding features to dynamic_class in order to avoid
 logic duplication and encapsulation breaking in make_named_class.

 The downside is that this makes this ticket depend on #12876 (ensuring
 that parent/element classes are purely abstract).

 All test should pass on 5.0.beta13, except for the two issues I mentionned
 in #12876. Oh, and one trivial failure I had forgotten in
 semigroup_cython.pyx. I'll update the patch later (tonight?) but you can
 start the review.

 I folded the two patches to get a better overview. You can access the
 differential patch by looking up
 
http://combinat.sagemath.org/patches/file/3121811e2ebe/trac11935_weak_pickling_by_construction_rel11943
 -review-nt.patch.

 Cheers,
                           Nicolas

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